:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-soft: #f6f8fb;
    --ink: #17212f;
    --muted: #6d7888;
    --line: #e3e9f1;
    --lime: #d9f466;
    --lime-strong: #bde842;
    --blue: #4567f0;
    --coral: #ff7a6b;
    --amber: #f6b94e;
    --shadow: 0 18px 55px rgba(28, 39, 58, .12);
    --radius: 24px;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.lucide {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.app-shell {
    width: min(1880px, calc(100vw - 48px));
    margin: 32px auto 48px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 34px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.site-header {
    height: 108px;
    padding: 24px 32px;
    display: grid;
    grid-template-columns: 300px minmax(260px, 560px) auto;
    gap: 24px;
    align-items: center;
    background: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--ink);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-mark span {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: var(--lime);
    position: relative;
}

.brand-mark span::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink);
    position: absolute;
    inset: 8px;
}

.brand strong {
    display: block;
    font-size: 24px;
    line-height: 1.1;
}

.brand small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.search-box {
    height: 50px;
    border-radius: 25px;
    background: #f0f3f8;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    color: #9aa4b2;
}

.search-box .lucide {
    width: 19px;
    height: 19px;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn .lucide {
    width: 17px;
    height: 17px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.dark {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 26px rgba(23, 33, 47, .18);
}

.btn.soft {
    background: #f0f3f8;
    color: var(--muted);
}

.btn.accent {
    background: var(--lime);
    color: var(--ink);
}

.btn.full {
    width: 100%;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: #f0f3f8;
    color: var(--muted);
    display: inline-grid;
    place-items: center;
}

.icon-btn .lucide {
    width: 20px;
    height: 20px;
}

.primary-nav {
    min-height: 64px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
}

.primary-list {
    display: flex;
    gap: 10px;
}

.primary-item {
    height: 42px;
    padding: 0 18px;
    border-radius: 21px;
    border: 0;
    background: transparent;
    font-weight: 800;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.primary-item .lucide {
    width: 17px;
    height: 17px;
}

.primary-item.active {
    background: var(--lime);
    color: var(--ink);
}

.primary-nav small {
    color: #97a2b0;
    margin-left: auto;
}

.layout {
    min-height: calc(100vh - 236px);
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 390px;
}

.sidebar {
    background: rgba(250, 251, 253, .92);
    border-right: 1px solid var(--line);
    padding: 30px 20px;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar h2,
.content h1,
.detail-panel h2,
.admin-card h2 {
    margin: 0;
}

.sidebar h2 {
    font-size: 22px;
}

.sidebar-head h2,
.filter-block h3,
.toolbar h1,
.section-title h2 {
    display: flex;
    align-items: center;
}

.sidebar-head h2 {
    gap: 9px;
}

.sidebar-head h2 .lucide {
    width: 20px;
    height: 20px;
    color: #708091;
}

#mobileFilterClose {
    display: none;
}

.category-list {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.category-row {
    height: 44px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--muted);
    text-align: left;
}

.category-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.category-label .lucide {
    width: 16px;
    height: 16px;
    color: #8d99a8;
}

.category-row.active .category-label .lucide {
    color: #536b24;
}

.category-row.active {
    background: #ecf9c8;
    border-color: #d3e986;
    color: var(--ink);
}

.category-count {
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.filter-block {
    margin-top: 34px;
}

.filter-block h3 {
    margin: 0 0 14px;
    font-size: 16px;
    gap: 8px;
}

.filter-block h3 .lucide {
    width: 17px;
    height: 17px;
    color: #8d99a8;
}

.style-chips,
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    min-height: 32px;
    border-radius: 16px;
    border: 0;
    padding: 0 14px;
    background: #f1f4f8;
    color: #536071;
    font-size: 13px;
    font-weight: 800;
}

.chip.active {
    background: var(--ink);
    color: #fff;
}

.content {
    padding: 34px 28px 52px;
    min-width: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.toolbar h1 {
    font-size: 30px;
    gap: 12px;
}

.toolbar h1 .lucide {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 12px;
    background: #ecf9c8;
    color: #526422;
}

.toolbar p,
.section-title p,
.detail-empty p,
.case-meta,
.muted-text {
    color: var(--muted);
}

.toolbar p {
    margin: 8px 0 0;
}

.mobile-filter {
    display: none;
}

.category-tabs {
    margin-top: 22px;
}

.section-title {
    margin: 30px 0 16px;
}

.section-title h2 {
    margin: 0;
    font-size: 20px;
    gap: 9px;
}

.section-title h2 .lucide {
    width: 19px;
    height: 19px;
    color: #708091;
}

.section-title p {
    margin: 0;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 22px;
}

.case-card {
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(28, 39, 58, .08);
    overflow: hidden;
    text-align: left;
    padding: 14px;
    transition: transform .16s ease, border .16s ease, box-shadow .16s ease;
}

.case-card:hover,
.case-card.active {
    transform: translateY(-2px);
    border-color: #dbe3ed;
    box-shadow: 0 18px 46px rgba(28, 39, 58, .14);
}

.case-cover {
    height: 220px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: #e8edf4;
}

.case-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-row {
    position: absolute;
    inset: 12px 12px auto 12px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.badge {
    height: 30px;
    padding: 0 14px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    background: rgba(23, 33, 47, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
}

.badge .lucide {
    width: 14px;
    height: 14px;
}

.badge.light {
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
}

.case-card h3 {
    margin: 16px 4px 6px;
    font-size: 19px;
    line-height: 1.35;
}

.case-meta {
    margin: 0 4px 12px;
    font-size: 13px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 4px 16px;
}

.tag {
    min-height: 26px;
    padding: 5px 11px;
    border-radius: 13px;
    background: #ecf9c8;
    color: #526071;
    font-size: 12px;
    font-weight: 800;
}

.tag:nth-child(2n) {
    background: #e9f2ff;
}

.tag:nth-child(3n) {
    background: #fff0e8;
}

.case-footer {
    margin: 0 4px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.case-footer .lucide {
    width: 14px;
    height: 14px;
    margin-top: 1px;
    color: #8d99a8;
}

.detail-panel {
    border-left: 1px solid var(--line);
    background: rgba(250, 251, 253, .78);
    padding: 34px 26px;
    min-width: 0;
}

.detail-card {
    position: sticky;
    top: 20px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 16px 44px rgba(28, 39, 58, .1);
    padding: 20px;
}

.detail-empty {
    border-radius: var(--radius);
    background: #fff;
    padding: 28px;
}

.detail-empty-icon {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 11px;
    background: #ecf9c8;
    color: #536b24;
    margin-bottom: 16px;
}

.detail-hero {
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    background: #e8edf4;
}

.detail-hero img,
.thumb img,
.detail-segment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-card h2 {
    margin: 20px 0 8px;
    font-size: 24px;
    line-height: 1.35;
}

.detail-summary {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.thumb {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 5px 15px rgba(28, 39, 58, .12);
    flex: 0 0 auto;
}

.detail-facts {
    margin: 18px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.detail-facts > span {
    min-width: 0;
    min-height: 34px;
    border-radius: 17px;
    background: #f1f4f8;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #536071;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
    overflow: hidden;
}

.detail-facts > span .lucide {
    width: 15px;
    height: 15px;
    color: #7e8b9a;
}

.detail-facts > span > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-facts > .detail-fact-code {
    padding-inline: 10px;
    gap: 5px;
}

.detail-facts > .detail-fact-code > span {
    font-size: 11px;
}

.detail-segments {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detail-segment {
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    background: #e8edf4;
    position: relative;
}

.detail-segment span {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 26px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .9);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.image-preview-trigger {
    position: relative;
    cursor: zoom-in;
}

.image-preview-trigger::after {
    content: "点击放大";
    position: absolute;
    right: 12px;
    bottom: 12px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    background: rgba(23, 33, 47, .72);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease;
    pointer-events: none;
}

.image-preview-trigger:hover::after,
.image-preview-trigger:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.thumb.image-preview-trigger::after {
    content: "+";
    right: 5px;
    bottom: 5px;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
}

.detail-actions {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.full-detail-btn {
    grid-column: 1 / -1;
}

.long-image-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(23, 33, 47, .46);
    padding: 28px;
    display: grid;
    place-items: center;
}

.long-image-sheet {
    width: min(980px, 100%);
    max-height: calc(100vh - 56px);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(23, 33, 47, .28);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.long-image-sheet header {
    min-height: 66px;
    padding: 14px 18px 14px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.long-image-sheet strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.long-image-scroll {
    overflow: auto;
    background: #f1f4f8;
    display: grid;
    justify-items: center;
}

.long-image-scroll img {
    width: min(100%, 950px);
    max-width: 100%;
    height: auto;
    background: #fff;
}

.image-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    padding: 30px;
    background: rgba(11, 17, 26, .78);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.image-viewer-frame {
    margin: 0;
    min-width: 0;
    height: min(86vh, 920px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
    justify-items: center;
    align-items: center;
}

.image-viewer-frame img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .35);
}

.image-viewer-frame figcaption {
    max-width: min(920px, 100%);
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.image-viewer-close {
    position: fixed;
    right: 26px;
    top: 24px;
    z-index: 1;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
}

.image-viewer-nav {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 34px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.image-viewer-nav:disabled {
    opacity: .38;
    cursor: default;
}

.empty-state {
    min-height: 260px;
    border: 1px dashed #cfd8e5;
    border-radius: var(--radius);
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-state h3 {
    color: var(--ink);
    margin: 0 0 8px;
}

.mobile-overlay {
    display: none;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 16px);
    min-width: 220px;
    max-width: calc(100vw - 40px);
    padding: 13px 18px;
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 40;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 1380px) {
    .app-shell {
        width: min(1180px, calc(100vw - 28px));
    }

    .layout {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .detail-panel {
        display: none;
    }
}

@media (max-width: 900px) {
    body {
        background: #eef2f6;
    }

    .app-shell {
        width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .site-header {
        height: auto;
        padding: 18px 18px 14px;
        grid-template-columns: 1fr auto;
        gap: 14px;
    }

    .brand strong {
        font-size: 20px;
    }

    .search-box {
        grid-column: 1 / -1;
        order: 3;
    }

    .header-actions .btn.dark {
        display: none;
    }

    .primary-nav {
        padding: 10px 18px;
        overflow-x: auto;
        align-items: flex-start;
        scrollbar-width: none;
    }

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

    .primary-nav small {
        display: none;
    }

    .layout {
        display: block;
        min-height: 0;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 320px);
        z-index: 31;
        transform: translateX(-104%);
        transition: transform .2s ease;
        box-shadow: 18px 0 44px rgba(23, 33, 47, .18);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    #mobileFilterClose,
    .mobile-filter {
        display: inline-flex;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(23, 33, 47, .24);
        z-index: 30;
    }

    .mobile-overlay.show {
        display: block;
    }

    .content {
        padding: 24px 16px 44px;
    }

    .toolbar h1 {
        font-size: 24px;
    }

    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .category-tabs .chip {
        flex: 0 0 auto;
    }

    .section-title {
        display: block;
    }

    .section-title p {
        margin-top: 5px;
        font-size: 13px;
    }

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

    .case-card {
        padding: 10px;
        border-radius: 18px;
    }

    .case-cover {
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 14px;
    }

    .badge-row {
        inset: 8px;
    }

    .badge {
        height: 26px;
        padding: 0 9px;
        font-size: 11px;
    }

    .case-card h3 {
        font-size: 15px;
        margin: 12px 2px 4px;
    }

    .case-meta,
    .case-footer {
        font-size: 11px;
    }

    .tag-row {
        gap: 6px;
        margin-bottom: 10px;
    }

    .tag {
        min-height: 22px;
        padding: 4px 8px;
        font-size: 11px;
    }

    .detail-panel.mobile-detail {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        padding: 16px;
        overflow-y: auto;
        background: rgba(238, 242, 246, .94);
    }

    .detail-panel.mobile-detail .detail-card {
        position: relative;
        top: 0;
        max-width: 460px;
        margin: 0 auto;
    }

    .mobile-close {
        display: inline-flex;
        position: absolute;
        right: 18px;
        top: 18px;
        z-index: 2;
    }

    .image-viewer-modal {
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .image-viewer-frame {
        width: 100%;
        height: calc(100vh - 132px);
        margin-top: 34px;
    }

    .image-viewer-frame img {
        border-radius: 14px;
    }

    .image-viewer-close {
        right: 14px;
        top: 14px;
    }

    .image-viewer-nav {
        position: fixed;
        bottom: 18px;
        width: 48px;
        height: 48px;
    }

    .image-viewer-prev {
        left: calc(50% - 60px);
    }

    .image-viewer-next {
        right: calc(50% - 60px);
    }
}

@media (max-width: 520px) {
    .site-header {
        grid-template-columns: 1fr;
    }

    .header-actions {
        display: none;
    }

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