.community-page {
    max-width: 1040px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.community-page > article.card {
    overflow-x: auto;
}

.community-list,
.board-list {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

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

.community-head p {
    margin: 0.35rem 0 0;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.community-guide-card,
.writing-template {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.community-guide-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.community-guide-card h2,
.writing-template h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 850;
}

.community-guide-card p {
    max-width: 720px;
    margin: 0.4rem 0 0;
    color: var(--text-sub);
    font-size: 0.9rem;
    line-height: 1.6;
}

.writing-template {
    padding: 1rem;
}

.writing-template ul {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.7rem;
    color: var(--text-sub);
    font-size: 0.88rem;
    line-height: 1.55;
    list-style: disc;
    padding-left: 1.2rem;
}

.community-board {
    overflow: hidden;
    padding: 0;
}

.board-header,
.board-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 110px 138px 72px;
    align-items: center;
    column-gap: 0.8rem;
    padding: 0.78rem 1rem;
}

.board-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 800;
}

.board-row {
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.board-row:hover {
    background: var(--primary-soft);
}

.board-row:last-child {
    border-bottom: 0;
}

.board-title,
.board-main {
    min-width: 0;
}

.board-title strong,
.board-main strong {
    display: block;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-title p,
.board-main p {
    margin: 0.26rem 0 0;
    overflow: hidden;
    color: var(--text-sub);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-cell {
    color: var(--text-sub);
    font-size: 0.84rem;
}

.type-badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.community-empty {
    padding: 1.4rem 1rem;
    color: var(--text-sub);
    text-align: center;
}

.board-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.page-link,
.board-pagination a,
.board-pagination .disabled {
    min-width: 52px;
    padding: 0.34rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.page-link.disabled,
.board-pagination a.disabled,
.board-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-status {
    color: var(--text-sub);
    font-size: 0.86rem;
}

.detail-top-actions {
    margin-bottom: 0;
}

.post-detail {
    margin-top: 0;
}

.post-detail.card,
.comments.card {
    padding: 1.05rem;
}

.post-head {
    margin-bottom: 0.9rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.post-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    color: var(--text-sub);
    font-size: 0.84rem;
}

.post-sub,
.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    color: var(--text-sub);
    font-size: 0.84rem;
}

.post-sub {
    margin: 0.45rem 0 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.post-content,
.comment-content {
    margin: 0;
    color: var(--text-main);
    font-family: inherit;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.post-actions form {
    margin: 0;
}

.detail-grid {
    display: block;
}

.comment-box h2 {
    margin: 0 0 0.7rem;
    font-size: 1rem;
}

.comment-box textarea,
.comments textarea,
.write-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
    padding: 0.65rem;
    font-size: 0.92rem;
    line-height: 1.55;
    resize: vertical;
}

.comment-box textarea:focus,
.comments textarea:focus,
.write-form textarea:focus,
.write-form input:focus,
.write-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.comment-submit {
    margin-top: 0.55rem;
    display: flex;
    justify-content: flex-end;
}

.comment-list {
    margin-top: 0.85rem;
    display: grid;
    gap: 0.6rem;
}

.comments > form {
    display: grid;
    gap: 0.6rem;
}

.comments > form .btn {
    justify-self: end;
}

.comment-login-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.comment-login-cta p {
    color: var(--text-sub);
    font-size: 0.88rem;
    line-height: 1.5;
}

.comment-item {
    position: relative;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.comment-actions button,
.comment-delete-top button {
    min-height: 28px;
    padding: 0.25rem 0.48rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-sub);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.comment-actions button:hover,
.comment-delete-top button:hover {
    border-color: var(--border-strong);
    color: var(--text-main);
}

.comment-meta {
    margin-bottom: 0.4rem;
    padding-right: 3rem;
}

.comment-item .post-meta {
    margin-bottom: 0.4rem;
    padding-right: 3rem;
}

.comment-delete-top {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    margin: 0;
}

.write-form {
    display: grid;
    gap: 0.6rem;
    padding: 1.05rem;
}

.write-form label {
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 800;
}

.write-form select {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-main);
    padding: 0.5rem 0.65rem;
}

.write-form input,
.write-form select,
.write-form textarea {
    min-width: 0;
}

.write-form .form-actions {
    margin-top: 0.2rem;
}

.form-help {
    margin: -0.15rem 0 0.1rem;
    color: var(--text-sub);
    font-size: 0.8rem;
}

.write-actions {
    margin-top: 0.45rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.error-text {
    margin: 0 0 0.6rem;
    color: var(--negative);
    font-size: 0.9rem;
    font-weight: 700;
}

.success-text {
    margin: 0 0 0.6rem;
    color: var(--positive);
    font-size: 0.9rem;
    font-weight: 700;
}

.community-page .table-card {
    overflow-x: auto;
}

.community-page .table-card table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.community-page .table-card th,
.community-page .table-card td {
    padding: 0.52rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.86rem;
    text-align: left;
    white-space: nowrap;
}

.community-page .table-card th {
    background: var(--surface-muted);
    color: var(--text-sub);
    font-weight: 800;
}

.community-page .table-card tr:last-child td {
    border-bottom: 0;
}

.report-item {
    display: grid;
    gap: 0.35rem;
}

.report-item p {
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.report-modal {
    display: none;
    z-index: 1200;
}

.report-modal .modal-content {
    width: min(100%, 460px);
    padding: 1rem;
}

.report-modal textarea {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    resize: vertical;
}

.report-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .community-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-guide-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .community-guide-card .btn {
        width: 100%;
    }

    .board-header {
        display: none;
    }

    .board-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 0.85rem 1rem;
    }

    .board-main strong,
    .board-main p {
        white-space: normal;
    }

    .board-cell {
        font-size: 0.82rem;
    }

    .write-actions,
    .form-actions,
    .comments > form .btn {
        justify-content: stretch;
        justify-self: stretch;
    }

    .write-actions .btn,
    .form-actions .btn,
    .comment-login-cta .btn {
        flex: 1;
    }
}
