body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    font-size: 0.9em;
}

#board {
    max-width: 720px;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.notice {
    background-color: #e7f3ff;
    border: 1px solid #cce5ff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.notice ul {
    padding-left: 0;
    margin-top: 5px;
    margin-bottom: 5px;
    list-style-type: none;
}

.notice li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 5px;
}

.notice li::before {
    content: '➥';
    position: absolute;
    left: 0;
    top: 0;
}

.post-form {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
}

#post-author, #post-email, #post-password {
    flex: 1;
}

.password-notice {
    flex: 1;
    font-size: 0.8em;
    color: #666;
    align-self: center;
    /* text-align is already left by default for block/flex items */
    padding-left: 10px;
}

#post-title {
    width: 100%;
    box-sizing: border-box;
}

#post-content {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    min-height: 120px; /* 높이 조정 */
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

#submit-post {
    padding: 12px 20px;
    background-color: #6c757d; /* 버튼 색상 변경 */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
    font-weight: bold;
}

#submit-post:hover {
    background-color: #0056b3;
}

#posts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#posts-container .post {
    /* border: 1px solid #000; */ /* 본문 테두리 제거 */
    margin-bottom: 15px;
    border-radius: 0;
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); */ /* 그림자 제거 */
    /* border: 1px solid #eee; */ /* 연한 테두리도 최종 제거 */
}

.post-header, .post-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

.post-header {
    gap: 10px;
    /* 자식 요소들이 수직 중앙 정렬되도록 */
    align-items: center;
}

.post-title-bar {
    background-color: rgb(224, 208, 160);
    color: rgb(0, 0, 0);
    font-weight: bold;
}

.post-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-number {
    font-weight: bold;
}

.author a {
    text-decoration: none;
    color: #0000EE;
}

.homepage-link {
    margin-left: 5px;
}

.post-content {
    padding: 20px;
    white-space: pre-wrap;
}

.reply-button, .delete-button {
    background: none;
    border: 1px solid #000;
    cursor: pointer;
    padding: 2px 5px;
    margin-left: 5px;
}

.delete-button {
    border-color: #dc3545;
    color: #dc3545;
}

.post .reply-button:hover, .post .delete-button:hover {
    text-decoration: underline;
}

.post-timestamp {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 0 0.5em;
    text-align: right;
}

.post-timestamp .date,
.post-timestamp .time {
    white-space: nowrap;
}

.post-timestamp .time {
    font-size: 0.8em;
    color: #666;
}

.comments-count {
    font-size: 0.9em;
    color: #888;
    margin-left: 5px;
}

.comment {
    margin-top: 0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #FFF0E0; /* 부모에 배경색 적용 */
    padding-left: 20px; /* margin을 padding으로 변경 */
    position: relative;
}

.comment.has-delete-button {
    padding-top: 0; /* 삭제 버튼 공간 확보 방식 변경 */
}

.comment-delete-container {
    position: relative;
    background-color: #fff;
    padding: 5px 10px 5px 0;
    text-align: right;
    margin-left: -20px; /* 부모의 padding-left 만큼 당겨서 채움 */
    margin-bottom: 5px; /* 아래 요소와 간격 */
}

.comment .post-header {
    background-color: transparent; /* 헤더는 부모 배경색을 따름 */
    padding: 5px 10px 5px 0; /* 왼쪽 패딩은 부모가 담당 */
}

/* 헤더 내부의 타임스탬프를 오른쪽으로 보내기 위해 */
.comment .post-header .post-meta-left {
    flex-grow: 1;
}

.comment .comment-content-wrapper {
    background-color: #fff;
    /* border-top: 1px solid #e0d8ce; */ /* 제목 상단 선 제거 */
}

.comment .post-title-bar {
    background-color: transparent;
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px;
    border-top: none; /* wrapper가 top border를 가짐 */
}

.comment .post-content {
    background-color: transparent;
    padding: 15px 10px;
}

/* 기존 댓글 스타일 제거 */
.comment .post-title-bar {
    background-color: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
}

#submit-reply {
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
    font-weight: bold;
}

#submit-reply:hover {
    background-color: #218838;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    gap: 5px;
}

.pagination a, .pagination span {
    text-decoration: none;
    color: #007bff;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination .current {
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .disabled {
    color: #ccc;
    pointer-events: none;
}

.post.content-deleted .post-title-bar,
.post.content-deleted .post-content {
    color: #999;
    background-color: #f8f9fa;
}

.post.content-deleted .post-content {
    font-style: italic;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }

    #post-author, #post-password {
        flex-basis: auto;
    }

    .password-notice {
        padding-left: 0;
        padding-top: 5px;
        text-align: left;
        align-self: stretch; /* Ensure it takes full width to apply text-align */
    }
}
