/* 记忆空间公开列表 */
.spaces-hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 46px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(760px 360px at 88% 12%, var(--blue-100), transparent 65%),
        linear-gradient(130deg, var(--blue-25), #fff 58%, var(--canvas-deep));
}

.spaces-hero-orb {
    position: absolute;
    top: -150px;
    right: 10%;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: var(--blue-100);
    opacity: 0.42;
    pointer-events: none;
}

.spaces-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.spaces-hero h1 {
    margin: 8px 0 10px;
    font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.18;
    letter-spacing: -0.05em;
}

.spaces-hero-inner > div {
    min-width: 0;
}

.spaces-hero p {
    width: 100%;
    max-width: 620px;
    color: var(--muted);
    font-family: "Songti SC", "STSong", serif;
    font-size: 15px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.spaces-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 16px;
    color: var(--muted-2);
    font-size: 11px;
}

.spaces-hero-meta span,
.spaces-hero-meta a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.spaces-hero-meta a {
    color: var(--blue-600);
}

.spaces-hero-meta .icon {
    width: 13px;
    height: 13px;
}

.spaces-search {
    display: flex;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
    width: 320px;
    max-width: 100%;
    height: 44px;
    flex: 0 0 auto;
    padding: 0 7px 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
}

.spaces-search > span {
    color: var(--muted-2);
}

.spaces-search .icon {
    width: 15px;
    height: 15px;
}

.spaces-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--ink-2);
    background: transparent;
    font-size: 12px;
}

.spaces-search button {
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    color: #fff;
    background: var(--blue-500);
    font-size: 11px;
}

.spaces-page {
    padding-top: 34px;
    padding-bottom: 74px;
}

.spaces-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.space-directory-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.space-directory-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.space-directory-cover {
    position: relative;
    display: block;
    height: 138px;
    overflow: hidden;
    background: var(--blue-75);
}

.space-directory-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.space-directory-card:hover .space-directory-cover img {
    transform: scale(1.035);
}

.space-directory-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(11, 40, 70, 0.35));
    pointer-events: none;
}

.space-directory-cover-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: var(--blue-500);
    background:
        radial-gradient(280px 150px at 25% 10%, rgba(255, 255, 255, 0.9), transparent 70%),
        linear-gradient(135deg, var(--blue-50), var(--blue-100));
}

.space-directory-cover-fallback .icon {
    width: 29px;
    height: 29px;
}

.space-directory-cover-fallback small {
    color: var(--muted-2);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 7px;
    letter-spacing: 0.16em;
}

.space-directory-code {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 1;
    color: rgba(255, 255, 255, 0.8);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 7px;
    letter-spacing: 0.08em;
}

.space-directory-body {
    padding: 13px 15px 15px;
}

.space-directory-person {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
}

.space-directory-person > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.space-directory-person strong {
    overflow: hidden;
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-directory-person small {
    color: var(--muted-2);
    font-size: 8px;
}

.space-directory-title {
    display: block;
    overflow: hidden;
    margin-top: 8px;
    color: var(--ink);
    font-family: "Songti SC", "STSong", serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-directory-title:hover {
    color: var(--blue-600);
}

.space-directory-body > p {
    display: -webkit-box;
    overflow: hidden;
    min-height: 34px;
    margin: 5px 0 9px;
    color: var(--muted);
    font-family: "Songti SC", "STSong", serif;
    font-size: 10px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.space-directory-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #f0f6fc;
    border-bottom: 1px solid #f0f6fc;
    color: var(--muted-2);
    font-size: 8px;
}

.space-directory-stats span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.space-directory-stats .icon {
    width: 10px;
    height: 10px;
}

.space-directory-latest {
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
    padding-top: 9px;
}

.space-directory-latest > span {
    flex: 0 0 auto;
    color: var(--blue-500);
    font-size: 7px;
}

.space-directory-latest strong {
    overflow: hidden;
    flex: 1;
    color: var(--ink-2);
    font-family: "Songti SC", "STSong", serif;
    font-size: 9px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.space-directory-latest small {
    flex: 0 0 auto;
    color: var(--muted-2);
    font-size: 7px;
}

.spaces-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 64px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    text-align: center;
}

.spaces-empty > span {
    color: var(--blue-300);
}

.spaces-empty > span .icon {
    width: 34px;
    height: 34px;
}

.spaces-empty h2 {
    margin: 10px 0 4px;
    font-family: "Songti SC", "STSong", serif;
    font-size: 24px;
}

.spaces-empty p {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 11px;
}

@media (max-width: 1180px) {
    .spaces-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .spaces-hero {
        padding: 34px 0 30px;
    }

    .spaces-hero-inner {
        display: block;
    }

    .spaces-hero h1 {
        font-size: 38px;
    }

    .spaces-hero p {
        max-width: 100%;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .spaces-hero-inner {
        min-width: 0;
    }

    .spaces-hero-inner > div {
        width: 100%;
        min-width: 0;
    }

    .spaces-search {
        width: 100%;
        max-width: 100%;
        margin-top: 18px;
    }

    .spaces-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .space-directory-cover {
        height: 154px;
    }

    .spaces-page {
        padding-top: 22px;
        padding-bottom: 48px;
    }
}
