/* =================================================================== */
/* 1. 기본 스타일 및 초기화 (Reset)
/* =================================================================== */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    min-width: 1280px; /* 고정폭 레이아웃을 위한 최소 너비 */
    overflow-x: auto;  /* 최소 너비보다 좁아질 때 가로 스크롤바 생성 */
}

a {
    color: #333;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =================================================================== */
/* 2. 헤더 (Header)
/* =================================================================== */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    /* 헤더 내용을 감싸는 내부 컨테이너를 만들어 중앙 정렬 */
}

.header-inner {
    max-width: 1400px; /* ★★★ 헤더 내용의 최대 너비 지정 ★★★ */
    margin: 0 auto;    /* ★★★ 헤더 내용을 중앙에 배치 ★★★ */
    padding: 20px;     /* ★★★ 헤더 높이를 키우기 위해 패딩 확대 ★★★ */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
.header-left img {
    height: 50px; /* ★ 로고 크기 확대 */
}
.header-left h1 {
    margin: 0;
    font-size: 28px; /* ★ 제목 크기 확대 */
}
.header-left h1 a {
    color: inherit;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-form-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-form .input-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.login-form .input-container input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 180px;
}
.login-form .button-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#loginMessage {
    color: red;
    font-size: 12px;
}

/* =================================================================== */
/* 3. 공용 버튼 (Common Buttons)
/* =================================================================== */
.custom-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    color: #333;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-button:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
    text-decoration: none;
}
.custom-button.danger {
    background-color: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
}
.custom-button.danger:hover {
    background-color: #ebccd1;
}

/* =================================================================== */
/* 4. 메인 레이아웃 (Main Layout) - 수정됨
/* =================================================================== */
.container {
    width: 96%;
    max-width: 1400px;
    margin: 20px auto;
}

.top-section {
    display: grid;
    /* 왼쪽배너 | 게시판목록 | 메인콘텐츠 | 오른쪽배너 */
    grid-template-columns: minmax(200px, 1.5fr) minmax(220px, 2fr) minmax(600px, 7fr) minmax(200px, 1.5fr);
    gap: 20px;
    
}

.ad-banner-left,
.board-list-section,
.main-content-area,
.ad-banner-right {
    /* 이 공통 스타일은 각 grid 아이템의 기본 배경/패딩 등을 설정합니다. */
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ad-banner-left, .ad-banner-right {
    padding: 0;
}
.ad-banner-left img, .ad-banner-right img {
    width: 100%;
    height: auto;
    display: block;
}

/* ★★★ main-content-area 레이아웃 설정 (핵심 1) ★★★ */
.main-content-area {
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    
    /* Flexbox 설정을 추가하여 자식 요소들의 순서(order)를 제어할 수 있게 함 */
    display: flex;
    flex-direction: column;
}

/* 게시글 목록과 상세 보기는 각자의 스타일을 가짐 */
.post-list-section,
.post-detail-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ★★★ 게시글 상세 보기 활성화 시 레이아웃 제어 (핵심 2) ★★★ */

/* 기본 상태: 상세 보기는 숨겨져 있음 */
.main-content-area .post-detail-section {
    display: none;
}

/* JS에서 'post-view-active' 클래스가 추가되면 아래 스타일이 적용됨 */
.main-content-area.post-view-active .post-list-section {
    display: block;      /* ★ 목록을 숨기지 않고 항상 보이게 함 */
    order: 2;            /* 순서를 두 번째로 (아래로 보냄) */
    margin-top: 30px;    /* 본문과 목록 사이 간격 추가 */
}

.main-content-area.post-view-active .post-detail-section {
    display: block;      /* 상세 보기를 보이게 함 */
    order: 1;            /* 순서를 첫 번째로 (위로 올림) */
}

/* =================================================================== */
/* 5. 게시글 목록 (Post List)
/* =================================================================== */
.sort-options {
    text-align: right;
    margin-bottom: 15px;
}
.sort-options a, .sort-options span {
    margin-left: 10px;
    font-size: 0.9em;
    color: #555;
}
.sort-options .active {
    font-weight: bold;
    color: #000;
}

/* ★★★ 게시판 테이블 스타일 (단순화된 최종본) ★★★ */
.board-table .col-title-meta {
    width: auto;
    text-align: left;
    vertical-align: middle; /* 세로 중앙 정렬로 변경하여 균형 맞춤 */
    padding: 12px 10px; /* td에 직접 패딩을 줌 */
    word-wrap: break-word;
    word-break: break-all;
}

.board-table th, .board-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
}

.board-table thead th {
    background-color: #f9f9f9;
    font-weight: bold;
    border-top: 2px solid #333;
    border-bottom-width: 2px;
}

/* ★★★ 각 컬럼의 너비를 명확하게 설정 ★★★ */
.board-table .col-tag { width: 10%; }
.board-table .col-thumbnail { width: 80px; } /* 고정 픽셀값 권장 */
.board-table .col-title-meta { width: auto; } /* 제목/정보 컬럼은 남는 모든 공간을 사용 */
.board-table .col-views { width: 8%; }
.board-table .col-likes { width: 8%; }


/* ★★★ 제목/정보 컬럼의 내부 스타일 (단순화) ★★★ */

/* ★★★ 제목과 메타 정보를 감싸는 래퍼 스타일 ★★★ */
.title-meta-wrapper {
    /* 특별한 스타일이 필요 없습니다. */
}

/* 제목 링크 스타일 */
.post-title-link {
    display: block; /* a 태그를 블록 요소로 만들어 한 줄을 차지하게 함 */
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    padding: 0; /* 내부 패딩 초기화 */
    margin: 0; /* 내부 마진 초기화 */
    margin-bottom: 4px; /* 제목과 메타 정보 사이 간격 */
}

.post-title-link:hover .title-text {
    text-decoration: underline;
}

/* ★★★ 메타 정보(글쓴이, 날짜) 영역 스타일 ★★★ */
.meta-info {
    display: block; /* div는 기본적으로 block이지만 명시 */
    font-size: 0.85em;
    color: #777;
    padding: 0; /* 내부 패딩 초기화 */
    margin: 0; /* 내부 마진 초기화 */
}

.meta-info .author {
    font-weight: bold;
    color: #555;
}

.meta-info .date {
    margin-right: 10px;
}
.board-table .post-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* 페이지네이션 (Pagination) */
.pagination {
    text-align: center;
    padding: 20px 0;
}
.pagination a, .pagination span {
    color: #333;
    padding: 8px 16px;
    border: 1px solid #ddd;
    margin: 0 4px;
    transition: background-color .3s;
}
.pagination a:hover {
    background-color: #f1f1f1;
}
.pagination .active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* =================================================================== */
/* 6. 게시글 상세 보기 (Post Detail)
/* =================================================================== */
.post-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.post-meta-info {
    margin-bottom: 15px;
    color: #555;
    font-size: 0.9em;
}

/* 본문 상단 URL 래퍼 스타일 (JS에서 동적 생성 시) */

/* ★★★ 본문 상단 URL 래퍼 스타일 (최종 수정) ★★★ */
.post-url-wrapper {
    width: 100%;                  /* 부모(#post-content)의 너비를 꽉 채움 */
    box-sizing: border-box;       
    
    margin-bottom: 20px;          /* URL 영역과 실제 본문 내용 사이의 간격 */
    border-bottom: none;          /* 구분선 없음 */

    display: flex;                /* 내부 아이템(url-text, copy-button) 정렬을 위해 flex 사용 */
    align-items: center;          
    justify-content: flex-end;    /* ★ 자식 아이템들을 오른쪽 끝으로 정렬 */

    font-size: 0.9em;
    color: #666;
}

.post-url-wrapper .url-text {
    word-break: break-all;
    /* margin-right: auto; 는 justify-content: flex-end; 와 함께 쓸 때 불필요할 수 있으므로 제거 */
}

.post-url-wrapper .copy-button {
    margin-left: 10px;            /* URL 텍스트와 버튼 사이의 간격 */
    flex-shrink: 0;               /* 버튼이 찌그러지지 않도록 */
}

/* ★★★ 게시글 본문 컨테이너(#post-content) 스타일 수정 ★★★ */
#post-content {
    /* 기존 스타일 유지 */
    line-height: 1.7;
    min-height: 150px;
    font-size: 1em;

    /* ★★★ Flexbox 설정을 추가합니다. ★★★ */
    display: flex;
    flex-direction: column; /* 자식 요소들을 세로로 쌓음 */
    align-items: flex-start; /* 자식 요소들을 왼쪽 정렬 (기본값) */
}

#post-content img { /* 본문 내 이미지 스타일 */
    max-width: 100%;
    height: auto;
}

.post-meta-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 15px 0;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}
.post-actions .like-count-display {
    font-weight: bold;
}
#messageBox {
    position: absolute;
    left: calc(100% + 15px);
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    transition: opacity 0.6s ease, visibility 0.6s;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
#messageBox.show {
    visibility: visible;
    opacity: 1;
}

.post-edit-options {
    display: flex;
    gap: 10px;
}

/* =================================================================== */
/* 7. 댓글 (Comments)
/* =================================================================== */
.comment-section {
    margin-top: 30px;
}
.comment-section h3 {
    margin-bottom: 20px;
}
.comment {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment:last-child {
    border-bottom: none;
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: #666;
}
.comment-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.comment-author-info strong {
    color: #000;
}
.comment-actions {
    font-size: 0.9em;
}
.comment-actions a {
    color: #666;
    margin-left: 15px;
}
.comment-content {
    padding-left: 5px;
    line-height: 1.6;
    word-break: break-all;
}
.comment-form {
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.comment-form textarea {
    flex-grow: 1;
    height: 90px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}
.comment-form button {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.2s;
}
.comment-form button:hover {
    background-color: #555;
}
.comment-edit-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #007bff;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    line-height: 1.6;
    box-sizing: border-box;
    resize: none;
}

 <style>
        /* 초기 상태: 게시글 목록만 보이기 */
        .post-detail-section { display: none; }
Generated code
/* 게시글 클릭 시: 게시글 내용 보이기, 게시글 목록 숨기기 */
    .show-post-detail .post-list-section { display: none; }
    .show-post-detail .post-detail-section { display: block; }
    .show-post-list .post-list-section { display: block; }
    .show-post-list .post-detail-section { display: none; }
    .content-section.post-active .post-detail-section { display: block; order: 1; }
    .content-section.post-active .post-list-section { display: block; order: 2; }
    .post-detail-section { display: none; background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
    .content-section { display: flex; flex-direction: column; position: relative; width: 100%; margin-right: 20px; box-sizing: border-box; }
    .post-list-section { padding: 20px; border: 1px solid #ddd; }
    .post-meta { font-size: 0.9em; color: #777; margin-bottom: 15px; } /* 게시글 주소 표시용 스타일 */
    
    /* ★★★★★ 게시판 테이블 스타일 추가 ★★★★★ */
    .board-table {
        width: 100%;
        border-collapse: collapse; /* 테두리 겹침 제거 */
        margin-top: 15px;
        font-size: 0.9em;
    }
    
    .board-table th, .board-table td {
        padding: 10px 8px;
        border-bottom: 1px solid #ddd;
        text-align: center;
        vertical-align: middle;
    }
    
    .board-table thead th {
        background-color: #f9f9f9;
        font-weight: bold;
        border-top: 2px solid #333;
    }
    
    /* 각 컬럼의 너비 지정 */
    .board-table .col-tag { width: 8%; }
    .board-table .col-thumbnail { width: 10%; }
    .board-table .col-title { width: 41%; text-align: left; } /* 제목은 왼쪽 정렬 */
    .board-table .col-author { width: 12%; }
    .board-table .col-date { width: 13%; }
    .board-table .col-views { width: 8%; }
    .board-table .col-likes { width: 8%; }
    
    .board-table .post-thumbnail {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 4px;
    }
    .board-table .post-title {
        color: #333;
        text-decoration: none;
    }
    .board-table .post-title:hover {
        text-decoration: underline;
    }
    
    
    /* ★★★★★ 페이지네이션 스타일 추가 ★★★★★ */
    .pagination {
        text-align: center;
        padding: 20px 0;
    }
    .pagination a, .pagination span {
        color: #333;
        padding: 8px 16px;
        text-decoration: none;
        border: 1px solid #ddd;
        margin: 0 4px;
        transition: background-color .3s;
    }
    .pagination a:hover {
        background-color: #f1f1f1;
    }
    .pagination .active {
        background-color: #4CAF50;
        color: white;
        border: 1px solid #4CAF50;
    }
    /* ★★★★★★★★★★★★★★★★★★★★★ */
    /* ★★★★★ 정렬 링크 스타일 추가 ★★★★★ */
    .sort-options {
        text-align: right;
        margin-bottom: 10px;
    }
    .sort-options a, .sort-options span {
        margin-left: 10px;
        text-decoration: none;
        color: #555;
        font-size: 0.9em;
    }
    .sort-options .active {
        font-weight: bold;
        color: #000;
    }
    /* ★★★★★★★★★★★★★★★★★★★★★ */
    
    /* style.css */
.comment-count {
    color: red;
    font-weight: bold; /* 제목과 같은 굵기 */
    margin-left: 6px;
    white-space: nowrap; /* 댓글 수 자체는 줄바꿈 안됨 */
}

</style>