
/* 1. 전체 배경 및 초기화 */
body {
    background-color: #f4f4f4;
}

footer {
    background-color: #ffffff;
}        
/* 2. 게시판 전체 레이아웃 */
.mookhon-board-container {
    max-width: 1200px;
    margin: 50px auto; 
    width: 92%;
}

/* 3. 상단 헤더 영역 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 20px 0;
    background-color: transparent;
    flex-wrap: wrap; /* 모바일에서 자동 줄바꿈 */
    gap: 15px;
}

.board-title {
    font-size: 32px; font-weight: 500; color: #363853; margin: 0 0 0 10px; letter-spacing: -1px;
}

/* 🔍 검색바: 직각 디자인 유지 */
.search-box {
    display: flex; align-items: center; border: 1px solid #dcdcdc; border-radius: 0;
    height: 36px; background: #fff; width: 320px; box-sizing: border-box;
}

.search-box select {
    width: 90px; height: 100%; border: none; border-right: 1px solid #dcdcdc;
    padding: 0 25px 0 12px; color: #b0b0b0; font-size: 14px; outline: none;
    -webkit-appearance: none; appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat;
    background-position: calc(100% - 10px) center;
}

.search-box .input-wrapper { flex: 1; height: 100%; position: relative; display: flex; align-items: center; }
.search-box input { width: 100%; height: 100%; border: none; padding: 0 35px 0 12px; font-size: 14px; outline: none; }
.btn-search-icon { position: absolute; right: 10px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; }
.btn-search-icon svg { width: 18px; height: 18px; stroke: #dcdcdc; fill: none; }

/* 4. 흰색 바탕 본체 */
.board-main-content {
    background-color: #ffffff;
    border-top: 2px solid #363853;
    padding-bottom: 40px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .06);
}

/* 5. 카테고리 탭 (상단 분류) */
.board-tabs {
    display: flex; list-style: none; padding: 20px 60px; margin: 0;
    overflow-x: auto; /* 모바일 가로스크롤 */
}
.board-tabs::-webkit-scrollbar { display: none; }
.board-tabs li { padding: 8px 30px; cursor: pointer; font-size: 18px; font-weight: 400; color: #737489; position: relative; flex-shrink: 0; }
.board-tabs li:first-child { padding-left: 0; }
.board-tabs li:not(:last-child)::after { content: ''; width: 1px; height: 14px; background: #DDDDDD; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.board-tabs li.active { color: #e74438; font-weight: bold; }

/* 6. 게시판 리스트 */
.board-list { list-style: none; padding: 0 40px; margin: 0; }

/* 게시판 첫글 위에 1px solid line 귿기 (S) */
.board-list {
    border-top: none; 
}

/* 2. 첫 번째 게시물 아이템의 윗부분에만 선을 추가 */
.list-item:first-child {
    border-top: 1px solid #EBEBEB;
}

/* 3. (이미 있는 코드) 게시물 사이사이의 선 */
.list-item {
    border-bottom: 1px solid #EBEBEB;
    /* ... 나머지 스타일 ... */
}
/* 게시판 첫글 위에 1px solid line 귿기 (E) */

.list-item { display: flex; align-items: center; padding: 18px 10px; border-bottom: 1px solid #f2f2f2; }
/* 짝수리스트만 배경 컬러변경 */
/* .list-item:hover { background: #fafafa; }  */

/* 제목 영역 */
.subject {
    flex: 1; color: #363853; font-size: 16px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 8px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

.author { width: 150px; text-align: right; color: #363853; font-size: 14px; padding-right: 20px; flex-shrink: 0; }
.date { width: 100px; text-align: right; color: #bbb; font-size: 14px; flex-shrink: 0; }

/* 뱃지 및 아이콘 */
.category-badge {
    width: 72px; /*padding: 0 14px 0 14px;*/ height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 16px; padding-top: 1px; font-size: 14px; font-weight: 500; margin-right: 15px; border: 1px solid #eee; flex-shrink: 0;
}

/* 참고용 */
.category-badge.notice { color: #a361d1; border-color: #e8dbf2; background: #faf8fd; }
.category-badge.chat { color: #e7a542; border-color: #f7e9d5; background: #fffdf9; }
.category-badge.suggest { color: #51a5e1; border-color: #d9ecf9; background: #f8fbfe; }

.new-icon { background: #e74c3c; color: #fff; font-size: 10px; width: 15px; height: 15px; display: inline-flex; align-items: center; justify-content: center; border-radius: 2px; font-weight: bold; flex-shrink: 0; }

/* 📱 7. [핵심 수정] 모바일 전용 반응형 (768px 이하) */
@media (max-width: 768px) {
    .board-header { flex-direction: column; align-items: flex-start; }
    .search-box { width: 100%; }
    .board-list { padding: 0 15px; } /* 모바일 여백 줄임 */
    .board-tabs { padding: 20px 15px; }

    /* ✅ 제목 제외 모든 리스트 정보 숨김 */
    .category-badge, 
    .author, 
    .date { 
        display: none !important; 
    }

    /* ✅ 제목 가독성 강화 */
    .subject {
        font-size: 15px;
        padding: 5px 0;
    }
    .list-item {
        padding: 20px 10px; /* 터치하기 편하게 높이 조절 */
    }
}

/* 8. 하단 영역 */
.board-footer { display: flex; flex-direction: column; align-items: center; padding: 30px 40px 0 40px; }
.write-btn-wrapper { width: 100%; display: flex; justify-content: flex-end; margin-bottom: 20px; }
.btn-write { background: #e74438; color: #fff; border: none; padding: 12px 35px; border-radius: 4px; font-size: 15px; font-weight: bold; cursor: pointer; }
.pagination { display: flex; list-style: none; padding: 0; gap: 5px; }
.pagination li { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #777; border-radius: 2px; }
.pagination li.active { background: #363853; color: #fff; }

</style>

<style>
/* 펼침 영역 기본 숨김 */
.view-row {
    display: none;
    background: #fafafa;
}

.view-content-area {
    padding: 25px 20px 30px 90px;
    border-bottom: 1px solid #eee;
}

/* 본문 */
.post-body {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.content-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
}

/* 답변 태그 */
.answer-tag {
    display: inline-block;
    font-size: 12px;
    color: #e74438;
    font-weight: bold;
    margin-bottom: 8px;
}

/* hover 느낌 */
.list-item:hover {
    background: #f9f9f9;
}

/* 답변 박스 (기준 잡기 ⭐) */
.answer-box {
    position: relative; /* 👈 이거 추가 */
    background: #fff;
    border-left: 3px solid #e74438;
    padding: 0px 20px;
    border-radius: 0px;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee; /* 👈 여기 핵심 */
}

/* 답변 태그 */
.answer-tag {
    font-size: 12px;
    color: #e74438;
    font-weight: bold;
}

/* 날짜 (우측 상단) */
.answer-date {
    position: absolute;
    right: 20px;  /* padding 맞춰서 살짝 안쪽 */
    top: 15px;    /* padding 기준으로 정렬 */
    font-size: 12px;
    color: #999;
}

/* 답변 내용 */
.answer-text {
    margin-top: 0px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

/* 안내 문구 */
.answer-notice {
    margin-top: 10px;
    text-align: right;
    font-size: 12px;
    color: #e57373;
}

/* 댓글 영역 */
.comment-thread {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* 댓글 공통 */
.comment {
    margin-bottom: 10px;
    max-width: 100%;
}

/* 👉 고객 (왼쪽, 연한 배경 + 살짝 들여쓰기) */
.comment.user {
    margin-left: 10px;
}

.comment.user .comment-text {
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 10px;
    display: inline-block;
}

/* 👉 운영자 (왼쪽, 강조 스타일) */
.comment.admin {
    margin-left: 0;
}

.comment.admin .comment-text {
    background: #fff;
    border: 1px solid #eee;
    border-left: 3px solid #e74438;
    padding: 10px 14px;
    border-radius: 0px;
}

/* 입력창 */
.comment-input {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.comment-input textarea {
    flex: 1;
    height: 60px;
    border: 1px solid #ddd;
    padding: 10px;
    resize: none;
}

.btn-comment {
    background: #e74438;
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

/* 펼쳐진 영역 왼쪽 빨간 라인 */
.content-wrapper {
    position: relative;
    background: #fafafa;
    padding: 20px;
    border-radius: 6px;
}

/* 왼쪽 빨간 라인 */
.content-wrapper::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #e74438;
}

/* 모바일에서 본문영역 카테고리 영역 앞에까지 나오게 */
@media (max-width: 768px) {
    .view-content-area {
        padding: 20px 15px;
    }

    .view-content-area::before {
        left: 0; /* 라인도 딱 붙게 */
    }
}

/* 모바일에서 category-badge 보이게 */
@media (max-width: 768px) {
    .category-badge {
        display: flex !important; /* 👈 다시 살림 */
    }
}


/* --- 에디터 본문 및 답변 영역 통합 줄간격 보정 --- */

/* 1. 모든 p 태그 스타일 */
.post-body p {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 1.5em;
    line-height: 1.7;
}

/* 2. 내용이 비어있는 p 태그 처리 */
.post-body p:empty::before {
    content: "\00a0";
    display: inline;
}

/* 3. 리스트 숫자 강제 생성 및 간격 최적화 */
.post-body ol {
    list-style: none !important;
    counter-reset: mookhon-counter;
    margin: 20px 0 20px 5px !important;
    padding: 0 !important;
}

.post-body ol li {
    counter-increment: mookhon-counter;
    display: block !important;
    position: relative;
    padding-left: 20px !important; /* 숫자와 글자 사이 간격을 28px -> 20px로 축소 */
    margin-bottom: 10px !important;
    line-height: 1.6;
}

/* 가상 요소로 숫자 표시 */
.post-body ol li::before {
    content: counter(mookhon-counter) ".";
    position: absolute;
    left: 0;
    font-weight: normal !important;
    color: inherit;
}

/* 4. 이미지 스타일 */
.post-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* 5. 요소 간 상단 여백 조정 */
.post-body p + ol, 
.post-body ol + p {
    margin-top: 10px;
}
