.community-page {
    min-height: 100vh;
}

.community-page.modal-open {
    overflow: hidden;
}

.community-navbar {
    background: rgba(11, 15, 28, 0.92);
}

.community-shell {
    padding-top: 80px;
}

.community-hero {
    padding: 84px 0 40px;
}

.community-hero h1 {
    margin-bottom: 1rem;
}

.community-hero p {
    max-width: 720px;
    color: var(--gray);
    font-size: 1.05rem;
}

.community-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
}

.community-hero-actions {
    display: flex;
    justify-content: flex-end;
}

.admin-hero {
    padding-bottom: 24px;
}

.community-section {
    padding: 0 0 80px;
}

.board-list-shell,
.post-detail-shell {
    max-width: 1120px;
    margin: 0 auto;
}

.community-grid {
    display: grid;
    grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.community-sidebar,
.community-main {
    display: grid;
    gap: 1.5rem;
}

.community-card {
    background: rgba(21, 30, 51, 0.78);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.detail-card {
    min-height: 520px;
}

.community-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.community-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.92rem;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(11, 15, 28, 0.72);
    color: var(--white);
    padding: 0.85rem 1rem;
    font: inherit;
}

.field textarea {
    resize: vertical;
    min-height: 160px;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.field small {
    color: var(--gray);
    font-size: 0.78rem;
}

.field-textarea textarea {
    white-space: pre-wrap;
}

.secret-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--gray);
    font-size: 0.94rem;
}

.secret-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-status {
    min-height: 1.25rem;
    color: var(--gray);
    font-size: 0.86rem;
}

.form-status.error {
    color: var(--negative);
}

.form-status.success {
    color: var(--primary);
}

.btn-small {
    padding: 0.55rem 0.85rem;
    font-size: 0.84rem;
}

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

.post-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.compact-hint {
    padding: 0.7rem 0.9rem;
    font-size: 0.78rem;
}

.post-page-summary {
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--gray);
}

.post-list-card {
    position: sticky;
    top: 96px;
}

.board-list-only-card {
    width: 100%;
}

.board-post-list {
    grid-template-columns: 1fr;
}

.post-item-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-item-inline .post-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
}

.post-item-inline .post-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.post-item-inline .post-item-author {
    color: var(--gray);
}

.post-item-inline .post-item-time {
    color: var(--gray);
    font-size: 0.9em;
}

.post-item-inline .pill.secret {
    flex-shrink: 0;
}

.post-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(11, 15, 28, 0.55);
    padding: 0.95rem 1rem;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.post-item:hover,
.post-item.is-active {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(18, 26, 43, 0.85);
    transform: translateY(-1px);
}

.post-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.post-item-index {
    font-size: 0.74rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.post-item-header,
.detail-header-row,
.reply-meta,
.detail-meta-row,
.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.post-item-title,
.detail-title {
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.35;
}

.post-item-title {
    font-size: 1rem;
}

.post-open-chip {
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.55rem;
    white-space: nowrap;
}

.post-item-preview,
.detail-body,
.reply-body,
.detail-hint,
.empty-state p {
    color: var(--gray);
}

.post-item-preview,
.reply-body,
.detail-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.post-item-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.5;
}

.post-item-meta,
.reply-meta,
.detail-meta-row,
.upload-summary,
.admin-stats,
.detail-hint {
    font-size: 0.82rem;
    color: var(--gray);
}

.meta-badges,
.detail-badges,
.reply-badges,
.admin-stats {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pill.secret {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.pill.reply-pill {
    background: rgba(56, 189, 248, 0.18);
    color: var(--accent);
}

.pill.admin-pill {
    background: rgba(34, 197, 94, 0.18);
    color: var(--primary);
}

.detail-layout {
    display: grid;
    gap: 1.35rem;
}

.detail-content {
    display: grid;
    gap: 0.9rem;
}

.detail-hint {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(11, 15, 28, 0.55);
}

.detail-images,
.reply-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
}

.image-card {
    display: grid;
    gap: 0.45rem;
}

.image-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 15, 28, 0.7);
}

.image-card span {
    font-size: 0.8rem;
    color: var(--gray);
    word-break: break-all;
}

.unlock-card,
.reply-form-shell,
.reply-item {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(11, 15, 28, 0.55);
}

.reply-list {
    display: grid;
    gap: 0.9rem;
}

.reply-item {
    display: grid;
    gap: 0.8rem;
}

.reply-item.is-admin {
    border-color: rgba(34, 197, 94, 0.22);
}

.empty-state {
    min-height: 420px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 0.8rem;
}

.empty-state svg {
    width: 42px;
    height: 42px;
    color: var(--accent);
}

.empty-state h2 {
    font-size: 1.4rem;
}

.admin-auth-shell {
    display: grid;
    place-items: center;
}

.admin-login-card {
    width: min(100%, 440px);
}

.admin-actions {
    display: grid;
    gap: 0.8rem;
}

.hidden {
    display: none !important;
}

.danger-button {
    border-color: rgba(244, 63, 94, 0.32);
    color: #fecaca;
}

.danger-button:hover {
    background: rgba(244, 63, 94, 0.12);
}

.detail-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 700;
}

.upload-summary {
    margin-top: -0.35rem;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.72);
    backdrop-filter: blur(6px);
}

.modal-panel {
    position: relative;
    width: min(100%, 760px);
    max-height: calc(100vh - 3rem);
    overflow: auto;
}

.modal-card {
    margin: 0;
}

.modal-panel-detail {
    width: min(100%, 720px);
    max-height: calc(100vh - 3rem);
    overflow: auto;
}

.post-detail-body {
    min-height: 120px;
}

.post-detail-body .detail-title {
    font-size: 1.1rem;
    margin: 0;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(21, 30, 51, 0.96);
    backdrop-filter: blur(10px);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pagination-button {
    min-width: 40px;
    height: 40px;
    padding: 0 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(11, 15, 28, 0.65);
    color: var(--white);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(18, 26, 43, 0.9);
    transform: translateY(-1px);
}

.pagination-button.is-active {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.18);
    color: var(--white);
}

.pagination-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-nav {
    min-width: 64px;
}

.post-hero {
    padding-bottom: 28px;
}

@media (max-width: 1024px) {
    .community-grid {
        grid-template-columns: 1fr;
    }

    .detail-card {
        min-height: 0;
    }

    .post-list-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .community-shell {
        padding-top: 72px;
    }

    .community-hero {
        padding-top: 64px;
    }

    .community-card {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .community-card-header,
    .post-list-toolbar,
    .post-item-header,
    .detail-header-row,
    .detail-meta-row,
    .reply-meta,
    .admin-row-actions {
        align-items: flex-start;
    }

    .community-hero-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .community-hero-actions {
        width: 100%;
    }

    .community-hero-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .community-hero h1 {
        font-size: 2.3rem;
    }

    .community-hero p {
        font-size: 0.98rem;
    }

    .detail-images,
    .reply-images {
        grid-template-columns: 1fr 1fr;
    }

    .pagination {
        justify-content: stretch;
    }

    .pagination-button {
        flex: 1 1 64px;
    }

    .modal-shell {
        padding: 1rem;
    }
}
