/* =========================================
   커뮤니티 공통 페이지 레이아웃 (1440px 고정 & 2단 그리드)
   ========================================= */
.comm-page-container {
    max-width: 1440px !important;
    margin: 20px auto 50px;
    padding: 0 16px;
    display: grid;
    /* 왼쪽은 사이드바 200px 고정, 오른쪽 '1fr'은 포털 메인의 센터+우측 빈 공간까지 전부 차지함 */
    grid-template-columns: 200px 1fr;
    gap: 12px;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .comm-page-container {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.comm-sidebar {
    width: 200px !important;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    height: fit-content;
}
.comm-side-group { margin-bottom: 20px; }
.comm-side-group:last-child { margin-bottom: 0; }
.comm-side-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 10px;
    padding-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.comm-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}
.comm-menu-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.comm-menu-link.active {
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* 커뮤니티 메인 패널: 우측 라이트바 공간까지 100% 꽉 차게 확장 */
.comm-main-panel, 
.post-detail-box,
.form-card {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
}

/* 만약 소설 본문 래퍼 등에 강제 제한이 걸려 있다면 이 부분도 100%로 확장 */
.novel-post-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Board Header & Table Styles */
.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.board-title-box h1 {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}
.board-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}
.btn-write {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #FFF;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-write:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

/* Category Filter Chips */
.cat-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.cat-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.cat-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.cat-chip.active {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

/* Board Table */
.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.board-table th {
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
}
.board-table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.board-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.board-table .col-num { width: 60px; text-align: center; font-size: 13px; color: var(--text-muted); }
.board-table .col-title { text-align: left; }
.board-table .col-author { width: 140px; text-align: center; }
.board-table .col-date { width: 100px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.board-table .col-views { width: 70px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.board-table .col-likes { width: 70px; text-align: center; font-size: 12.5px; color: #EF4444; font-weight: 700; }

.post-title-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.post-title-link:hover {
    color: var(--accent-primary);
}
.badge-notice {
    background: #EF4444;
    color: #FFF;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}
.badge-cat {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.badge-biz {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.comment-cnt {
    color: var(--accent-primary);
    font-weight: 800;
    font-size: 12.5px;
    margin-left: 4px;
}

/* Gallery/Card View */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.gallery-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}
.gallery-thumb {
    width: 100%;
    height: 140px;
    background: #1E293B;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-play-icon {
    position: absolute;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.gallery-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.gallery-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

/* Pagination & Search Bar */
.board-footer {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.search-form {
    display: flex;
    gap: 6px;
}
.search-input {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
}
.btn-search {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}
.pagination {
    display: flex;
    gap: 4px;
}
.page-link {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.page-link.active {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

/* Post Detail & Form Elements */
.post-header-wrap {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}
.post-board-tag {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    text-decoration: none;
}
.post-title-main {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 14px 0;
}
.post-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.author-badge-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.author-name {
    font-weight: 700;
    color: var(--text-primary);
}
.post-content-body {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--text-primary);
    min-height: 160px;
    margin-bottom: 30px;
    white-space: pre-wrap;
    word-break: break-word;
}
.media-embed-box {
    margin: 20px 0;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 680px;
}
.media-embed-box iframe {
    width: 100%;
    height: 380px;
    border: none;
}
.post-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 36px 0;
    padding: 20px 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}
.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-like.liked {
    background: #EF4444;
    color: #FFF;
}
.btn-like:hover {
    transform: scale(1.05);
}
.comments-header {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-item {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}
.comment-item.reply {
    margin-left: 28px;
    background: rgba(255, 255, 255, 0.015);
    border-left: 3px solid var(--accent-primary);
}
.comment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}
.comment-author { font-weight: 700; color: var(--text-primary); }
.comment-date { color: var(--text-muted); font-size: 12px; }
.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.comment-write-box {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}
.comment-input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
}
.comment-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.btn-comment-submit {
    background: var(--accent-gradient);
    color: #FFF;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
}
.detail-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.btn-list-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}
.btn-list-back:hover { color: var(--text-primary); }

/* Form Elements */
.form-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.form-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea {
    resize: vertical;
    min-height: 240px;
    line-height: 1.6;
}
.form-check-group {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 16px 0;
}
.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}
.form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.btn-cancel {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14.5px;
}
.btn-submit {
    padding: 12px 28px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #FFF;
    border: none;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}