body { font-family: 'Noto Sans KR', sans-serif; }
/* CSS isolation for user content */
.db-user-content { display: block; font-family: 'Noto Sans KR', sans-serif; font-size: 16px; line-height: 1.6; color: #333; }
.db-user-content h1 { font-size: 2em; font-weight: bold; margin: 0.67em 0; }
.db-user-content h2 { font-size: 1.5em; font-weight: bold; margin: 0.83em 0; }
.db-user-content h3 { font-size: 1.17em; font-weight: bold; margin: 1em 0; }
.db-user-content h4 { font-size: 1em; font-weight: bold; margin: 1.33em 0; }
.db-user-content p { margin: 1em 0; }
.db-user-content ul, .db-user-content ol { margin: 1em 0; padding-left: 2em; }
.db-user-content ul { list-style: disc; }
.db-user-content ol { list-style: decimal; }
.db-user-content li { margin: 0.5em 0; }
.db-user-content img { max-width: 100%; height: auto; }
.db-user-content .note-float-left { float: left; margin: 0 1em 1em 0; }
.db-user-content .note-float-right { float: right; margin: 0 0 1em 1em; }
.db-user-content a { color: #0066cc; text-decoration: underline; }
.db-user-content table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.db-user-content td, .db-user-content th { border: 1px solid #ddd; padding: 8px; text-align: left; }
.db-user-content th { background: #f5f5f5; font-weight: bold; }
.db-user-content blockquote { border-left: 4px solid #ddd; margin: 1em 0; padding: 0.5em 1em; color: #666; }
.db-user-content pre { background: #f5f5f5; padding: 1em; border-radius: 4px; overflow-x: auto; }
.db-user-content code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.db-user-content hr { border: none; border-top: 1px solid #ddd; margin: 2em 0; }
/* Summernote editable area – restore HTML defaults stripped by Tailwind preflight */
.note-editable h1 { font-size: 2em; font-weight: bold; margin: 0.67em 0; }
.note-editable h2 { font-size: 1.5em; font-weight: bold; margin: 0.83em 0; }
.note-editable h3 { font-size: 1.17em; font-weight: bold; margin: 1em 0; }
.note-editable h4 { font-size: 1em; font-weight: bold; margin: 1.33em 0; }
.note-editable h5 { font-size: 0.83em; font-weight: bold; margin: 1.67em 0; }
.note-editable h6 { font-size: 0.67em; font-weight: bold; margin: 2.33em 0; }
.note-editable p { margin: 1em 0; }
.note-editable ul { list-style: disc; margin: 1em 0; padding-left: 2em; }
.note-editable ol { list-style: decimal; margin: 1em 0; padding-left: 2em; }
.note-editable li { margin: 0.25em 0; }
.note-editable blockquote { border-left: 4px solid #ddd; margin: 1em 0; padding: 0.5em 1em; color: #666; }
.note-editable a { color: #2563eb; text-decoration: underline; }
.note-editable table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.note-editable td, .note-editable th { border: 1px solid #ddd; padding: 8px; text-align: left; }
.note-editable th { background: #f5f5f5; font-weight: bold; }
.note-editable hr { border: none; border-top: 1px solid #ddd; margin: 1.5em 0; }
.note-editable pre { background: #f5f5f5; padding: 1em; border-radius: 4px; overflow-x: auto; }
.note-editable code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.note-editable img { max-width: 100%; height: auto; }

/* ========================================================================
   게시판 폼 — 원자 구조 (관리자 디자인 자유도 ↑)
   각 필드는 [bf-field > bf-label + bf-input] 으로 분리되어
   관리자가 .bf-field[data-field="..."] 셀렉터로 자유롭게 커스텀 가능.
   ======================================================================== */
.bf-form { width: 100%; }
.bf-form > * + * { margin-top: 16px; }

/* 행 컨테이너 — 여러 필드를 한 줄에 묶을 때 사용 */
.bf-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) {
    .bf-row.bf-row-2 { grid-template-columns: 1fr 1fr; }
    .bf-row.bf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
    .bf-row.bf-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* 개별 필드 (라벨 + 인풋) */
.bf-field { display: flex; flex-direction: column; min-width: 0; }
.bf-label {
    font-size: 14px; font-weight: 500; color: #374151;
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 8px;
}
/* 라벨의 첫 자식 (span) 에만 * 붙임 — 텍스트 바로 옆에 표시 */
.bf-field.bf-required > .bf-label > span:first-child::after,
.bf-field.bf-required > .bf-label > label:first-child::after {
    content: " *"; color: #ef4444; font-weight: bold; margin-left: 2px;
}
/* 라벨 안에 부가 요소(비밀글 토글, 파일크기 안내 등)는 우측 정렬 */
.bf-label > .bf-secret-toggle,
.bf-label > [data-aux] { margin-left: auto; }
.bf-help { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* 인풋 컨테이너 + 폼 컨트롤 공통 스타일 */
.bf-input { width: 100%; }
.bf-input input[type="text"],
.bf-input input[type="email"],
.bf-input input[type="tel"],
.bf-input input[type="number"],
.bf-input input[type="password"],
.bf-input input[type="url"],
.bf-input input[type="date"],
.bf-input select,
.bf-input textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-size: 14px;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
}
.bf-input input[type="file"] { width: auto; max-width: 100%; font-size: 13px; padding: 0; border: 0; background: transparent; }
.bf-input textarea { resize: vertical; min-height: 100px; }
.bf-input input:focus, .bf-input select:focus, .bf-input textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* readonly 변형 — 회원 자동 채움용 */
.bf-input input[readonly], .bf-input select[disabled] {
    background: #f9fafb; color: #6b7280; cursor: not-allowed; border-color: #e5e7eb;
}

/* radio · checkbox 그룹 */
.bf-input .bf-options { display: flex; flex-wrap: wrap; gap: 16px; }
.bf-input .bf-options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: #374151; }

/* 폼 내부 모든 체크박스 · 라디오 — 배경 흰색 / 체크/도트 검은색 */
.bf-form input[type="checkbox"],
.bf-form input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px; height: 18px;
    border: 1.5px solid #6b7280;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    vertical-align: middle;
    margin: 0;
    transition: border-color .15s ease;
}
.bf-form input[type="checkbox"] { border-radius: 4px; }
.bf-form input[type="radio"]    { border-radius: 50%; }
.bf-form input[type="checkbox"]:checked,
.bf-form input[type="radio"]:checked {
    background: #ffffff;
    border-color: #111827;
}
.bf-form input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border-right: 2px solid #111827;
    border-bottom: 2px solid #111827;
    transform: rotate(45deg);
}
.bf-form input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #111827;
    transform: translate(-50%, -50%);
}
.bf-form input[type="checkbox"]:focus,
.bf-form input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}
.bf-form input[type="checkbox"]:disabled,
.bf-form input[type="radio"]:disabled {
    cursor: not-allowed; opacity: .7;
}

/* 액션(버튼) 영역 */
.bf-actions { display: flex; gap: 8px; margin-top: 24px; }
.bf-actions .bf-submit {
    padding: 10px 24px; background: #2563eb; color: #fff; border: 0; border-radius: 8px;
    font-weight: 500; font-size: 14px; cursor: pointer;
}
.bf-actions .bf-submit:hover { background: #1d4ed8; }
.bf-actions .bf-cancel {
    padding: 10px 24px; background: #e5e7eb; color: #374151; border-radius: 8px;
    font-weight: 500; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center;
}
.bf-actions .bf-cancel:hover { background: #d1d5db; }

/* 비밀글 토글 (라벨 우측에 inline) */
.bf-secret-toggle { font-weight: normal; font-size: 13px; color: #6b7280; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* 개인정보 동의 체크박스 (라벨 없는 단독 필드) */
.bf-field[data-field="agree_privacy"] .bf-label { display: none; }
.bf-field[data-field="agree_privacy"] .bf-input { display: flex; align-items: center; gap: 8px; }

/* ========================================================================
   게시판 보기(view) — 원자 구조
   각 표시 항목은 [bv-field > bv-label + bv-value] 로 분리되어
   관리자가 .bv-field[data-field="..."] 로 자유롭게 커스텀 가능.
   기본은 메타 영역(작성자/날짜/조회수) 라벨 숨김 / custom field 라벨 표시.
   ======================================================================== */
.bv-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: #6b7280; }
.bv-field { display: inline-flex; align-items: center; gap: 4px; }
.bv-label { font-size: 13px; color: #9ca3af; }
.bv-value { color: inherit; }

/* 메타 영역의 기본 라벨은 숨김 — 값만 노출 (현재 UX 유지) */
.bv-meta > .bv-field > .bv-label { display: none; }

/* 추가 필드(custom field) 영역 — 라벨 + 값 형태 */
.bv-customfields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    padding: 16px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.bv-customfields .bv-field { display: flex; align-items: flex-start; }
.bv-customfields .bv-label {
    font-weight: 500; color: #4b5563;
    margin-right: 8px; min-width: 80px; flex-shrink: 0;
}
.bv-customfields .bv-value { color: #1f2937; }
.bv-customfields .bv-value a { color: #2563eb; text-decoration: underline; }
@media (max-width: 640px) {
    .bv-customfields { grid-template-columns: 1fr; }
}
