.community-page {
    display: grid;
    gap: 1.5rem;
}

.community-hero,
.community-controls,
.post-list-wrap,
.sidebar-card {
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.24);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.community-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 1.5rem;
    align-items: end;
    padding: 2rem;
}

.eyebrow {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.community-title {
    text-align: left;
    margin-bottom: 1rem;
}

.community-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.community-stat {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.community-stat strong {
    font-size: 1.5rem;
}

.community-stat span,
.community-meta,
.profile-snippet-meta,
.community-tips,
.post-meta,
.post-author span {
    color: var(--text-light);
}

.community-controls {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
}

.community-toolbar,
.community-search,
.community-filter-row,
.post-list-head,
.post-footer,
.post-actions,
.post-topline,
.post-author,
.profile-snippet {
    display: flex;
    gap: 0.75rem;
}

.community-toolbar,
.community-filter-row,
.post-list-head,
.post-footer,
.post-topline {
    justify-content: space-between;
    align-items: flex-start;
}

.community-search {
    flex: 1;
}

.community-search-input,
.community-sort-select,
.compose-dialog input,
.compose-dialog select,
.compose-dialog textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.68);
    color: var(--text-dark);
    outline: none;
}

.community-search-input {
    min-height: 48px;
    padding: 0 1rem;
    font-size: 1rem;
    border-radius: 12px;
}

.community-search-input:focus,
.community-sort-select:focus,
.compose-dialog input:focus,
.compose-dialog select:focus,
.compose-dialog textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.community-search-btn,
.community-compose-btn,
.community-reset-btn {
    border-radius: 12px;
    white-space: nowrap;
}

.community-filters {
    justify-content: flex-start;
    margin-bottom: 0;
}

.community-filters .filter-btn,
.community-reset-btn,
.post-action,
.hot-topic {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(30, 41, 59, 0.66);
    color: var(--text-dark);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.community-filters .filter-btn {
    border-radius: 999px;
}

.community-filters .filter-btn.active,
.post-action.is-active {
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(37, 99, 235, 0.28);
    color: #f8fafc;
}

.community-filters .filter-btn[data-category="我的收藏"].active {
    border-color: rgba(251, 191, 36, 0.48);
    background: rgba(180, 83, 9, 0.26);
    color: #fef3c7;
}

.community-sort-field {
    display: grid;
    gap: 0.35rem;
    min-width: 160px;
}

.community-sort-field span {
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 700;
}

.community-sort-select {
    min-height: 42px;
    padding: 0 0.85rem;
    border-radius: 12px;
    font-weight: 700;
}

.community-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
}

.post-list-wrap {
    padding: 1.5rem;
}

.post-list-head {
    margin-bottom: 1rem;
}

.community-reset-btn {
    min-height: 38px;
    padding: 0 0.9rem;
    border-radius: 999px;
}

.post-list {
    display: grid;
    gap: 1rem;
}

.post-item {
    display: grid;
    gap: 0.9rem;
    padding: 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.64);
    transition: var(--transition);
}

.post-item:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.34);
    background: rgba(15, 23, 42, 0.78);
}

.post-item.is-pinned {
    border-color: rgba(56, 189, 248, 0.34);
}

.post-avatar,
.profile-snippet-avatar {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb, #0f766e);
}

.post-author {
    align-items: center;
}

.post-author strong,
.profile-snippet-name {
    color: var(--white);
}

.post-author span {
    display: block;
    font-size: 0.84rem;
}

.post-status {
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.18);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.post-title {
    font-size: 1.22rem;
    line-height: 1.45;
}

.post-title a {
    color: var(--white);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-desc {
    color: rgba(226, 232, 240, 0.88);
    line-height: 1.75;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tag {
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(96, 165, 250, 0.14);
    color: var(--primary-color);
    cursor: pointer;
}

.post-footer {
    align-items: center;
    padding-top: 0.25rem;
}

.post-meta,
.post-actions {
    flex-wrap: wrap;
    align-items: center;
}

.post-meta {
    font-size: 0.86rem;
}

.post-action {
    min-height: 34px;
    padding: 0 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
}

.post-action-icon {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
}

.post-action-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-action-icon.is-active svg {
    fill: currentColor;
}

.post-action-icon:focus-visible,
.community-reset-btn:focus-visible,
.hot-topic:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.9);
    outline-offset: 3px;
}

.post-action:hover,
.community-reset-btn:hover,
.hot-topic:hover {
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(37, 99, 235, 0.22);
    color: #f8fafc;
}

.post-action-danger {
    border-color: rgba(248, 113, 113, 0.32);
    color: #fecaca;
}

.post-action-danger:hover {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(185, 28, 28, 0.22);
    color: #fff;
}

.post-item mark {
    padding: 0 0.15em;
    border-radius: 0.25rem;
    background: rgba(250, 204, 21, 0.28);
    color: #fde68a;
}

.community-empty {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.62);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    color: var(--text-light);
}

.community-toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    z-index: 60;
    min-width: 150px;
    max-width: min(320px, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.32);
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.32);
    font-weight: 800;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.sidebar-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.sidebar-card h3 {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding-bottom: 0.6rem;
}

.profile-snippet {
    align-items: center;
    margin-bottom: 1rem;
}

.profile-link {
    text-align: center;
    border-radius: 12px;
}

.hot-topic {
    width: 100%;
    min-height: 40px;
    padding: 0 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    text-align: left;
}

.hot-mark {
    color: #fde68a;
}

.community-tips {
    display: grid;
    gap: 0.6rem;
    padding-left: 1rem;
    list-style: disc;
}

.compose-panel {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.74);
}

.compose-panel[hidden] {
    display: none;
}

.compose-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(760px, 90vh);
    overflow: auto;
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
}

.compose-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    min-height: 34px;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    cursor: pointer;
}

.compose-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 1rem;
}

.compose-grid label {
    display: grid;
    gap: 0.4rem;
    color: var(--text-light);
    font-weight: 700;
}

.compose-full {
    grid-column: 1 / -1;
}

.compose-dialog input,
.compose-dialog select,
.compose-dialog textarea {
    min-height: 44px;
    padding: 0.8rem;
    border-radius: 12px;
    font-family: inherit;
}

.compose-dialog textarea {
    min-height: 130px;
    resize: vertical;
}

.compose-counter {
    justify-self: end;
    margin-top: -0.15rem;
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
}

.compose-counter.is-near-limit {
    color: #fbbf24;
}

.compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.compose-actions .btn {
    border-radius: 12px;
}

.compose-note {
    min-height: 1.5rem;
    color: var(--primary-color);
}

@media (max-width: 900px) {
    .community-hero,
    .community-layout,
    .compose-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .community-toolbar,
    .community-search,
    .community-filter-row,
    .post-list-head,
    .post-footer,
    .post-topline {
        flex-direction: column;
    }

    .community-search-btn,
    .community-compose-btn,
    .community-sort-field,
    .community-reset-btn {
        width: 100%;
    }

    .community-stats {
        grid-template-columns: 1fr;
    }

    .post-actions {
        width: 100%;
    }

    .post-action {
        flex: 1;
        justify-content: center;
    }

    .post-action-icon {
        flex: 0 0 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .community-toast {
        transition: none;
    }
}
