@charset "utf-8";

/* ============================================================
   BASE
============================================================ */
#bo_list {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 12px;
}


/* ============================================================
   SEARCH
============================================================ */
#bo_sch {
    display: flex;
    justify-content: flex-end;
    border: 0;
    padding: 0;
    margin: 0 0 16px;
}
#bo_sch form { width: 50%; }


/* ============================================================
   CATEGORY
============================================================ */
#bo_cate { margin: 0 0 16px; }

/* 접근성: 제목 숨김 */
#bo_cate h2 {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
#bo_cate ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0; margin: 0;
}
#bo_cate li { display: inline-block; }
#bo_cate a {
    display: block;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    color: var(--text-muted, #888888);
    text-decoration: none;
    font-size: 0.88em;
    transition: all 0.2s;
}
#bo_cate a:hover,
#bo_cate #bo_cate_on {
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
}


/* ============================================================
   WRITE AREA
============================================================ */
.memo-write-area {
    background: var(--card-bg-color, rgba(255,255,255,0.75));
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.memo-write-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.memo-write-body { flex: 1; }

/* 글쓰기 아바타 */
.memo-write-avatar {
    width: 46px; height: 46px;
    border-radius: 30px;
    overflow: hidden;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-write-avatar img { width: 100%; height: 100%; object-fit: cover; }
.memo-write-avatar .fa-user-circle { font-size: 36px; color: var(--text-muted, #888888); line-height: 1; }

/* 텍스트 입력 */
.memo-input {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--input-border-color, #eee);
    border-radius: 12px;
    background: #ffffff85;
    color: var(--content-font-color, #333333);
    font-size: 1em;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-input::placeholder { color: var(--text-muted, #888888); opacity: 0.7; }
.memo-input:focus { border-bottom-color: var(--primary-color, #7ba7c9); }

/* 하단 바 */
.memo-write-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.memo-select {
    padding: 6px 12px;
    border: 1px solid var(--input-border-color, #ddd);
    border-radius: 20px;
    background: var(--form-bg-color, rgba(255,255,255,0.9));
    color: var(--form-text-color, #333333);
    font-size: 0.88em;
    cursor: pointer;
}
.memo-submit-btn {
    padding: 7px 20px;
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.memo-submit-btn:hover { filter: brightness(0.95); transform: translateY(-1px); }


/* ============================================================
   TOOLBAR (이미지 · 스포일러 · 비밀글)
============================================================ */
.memo-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}

/* 공통 아이콘 버튼 */
.memo-img-btn,
.memo-secret-btn,
.memo-spoiler-btn,
.memo-url-img-btn,
.memo-reply-spoiler-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.memo-img-btn,
.memo-secret-btn,
.memo-url-img-btn,
.memo-reply-spoiler-btn {
    width: 30px; height: 30px;
}
.memo-img-btn    { font-size: 1em; }
.memo-secret-btn { font-size: 0.95em; }
.memo-spoiler-btn { font-size: 1.1em; padding: 4px 6px; line-height: 1; }
.memo-url-img-btn { font-size: 0.95em; }
.memo-reply-spoiler-btn { font-size: 1em; }

/* 브라우저 기본 button 스타일 제거 - 카드 배경색에 녹아들도록 */
.memo-url-img-btn,
.memo-reply-spoiler-btn {
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    box-shadow: none;
    outline: none;
    border: none;
}

.memo-img-btn:hover,
.memo-secret-btn:hover,
.memo-url-img-btn:hover,
.memo-reply-spoiler-btn:hover { background: var(--light-bg-color, rgba(255,255,255,0.25)); }
.memo-img-btn:hover,
.memo-url-img-btn:hover       { color: var(--primary-color, #7ba7c9); }
.memo-spoiler-btn:hover       { color: var(--text-color, #333); background: rgba(0,0,0,0.06); }
.memo-reply-spoiler-btn:hover { color: var(--text-color, #333); }

.memo-secret-btn.active .memo-secret-icon,
.memo-secret-btn .fa-lock { color: var(--primary-color, #7ba7c9); }


/* ============================================================
   이미지 미리보기 (업로드 전 썸네일)
============================================================ */
.memo-img-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
}
.memo-img-preview-item {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-border-color, #eee);
}
.memo-img-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.memo-img-remove-btn {
    position: absolute;
    top: 3px; right: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 0.7em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.memo-img-remove-btn:hover { background: rgba(200,0,0,0.8); }

/* 댓글용 미리보기 (크기만 축소) */
.memo-reply-img-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}
.memo-reply-img-preview-area .memo-img-preview-item { width: 60px; height: 60px; }


/* ============================================================
   이미지 그리드 (본문 표시)
============================================================ */
.memo-img-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    width: 100%;
}
.memo-img-thumb {
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid var(--card-border-color, #eee);
    transition: opacity 0.15s;
    display: block;
}
.memo-img-thumb:hover { opacity: 0.88; }

/* 장수별 레이아웃 */
.memo-img-grid.count-1 .memo-img-thumb  { width: 100%; height: auto; object-fit: unset; border-radius: 12px; }
.memo-img-grid.count-2 .memo-img-thumb  { width: calc(50% - 3px); height: 170px; }
.memo-img-grid.count-3 .memo-img-thumb:first-child     { width: 100%; height: 190px; }
.memo-img-grid.count-3 .memo-img-thumb:not(:first-child){ width: calc(50% - 3px); height: 120px; }
.memo-img-grid.count-4 .memo-img-thumb  { width: calc(50% - 3px); height: 140px; }


/* ============================================================
   비밀글
============================================================ */
.memo-secret-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(100,100,200,0.1);
    color: #6060cc;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}
.memo-item.memo-secret { border-left: 3px solid rgba(100,100,200,0.35); }
.memo-secret-placeholder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    border-radius: 10px;
    color: var(--text-muted, #888888);
    font-size: 0.9em;
    margin: 4px 0;
}


/* ============================================================
   LIST
============================================================ */
.memo-list-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ============================================================
   ITEM
============================================================ */
.memo-item {
    display: flex;
    gap: 12px;
    background: var(--card-bg-color, rgba(255,255,255,0.75));
    border-radius: 20px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.memo-item:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* 아바타 */
.memo-avatar {
    width: 38px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.memo-avatar > img,
.memo-avatar > .fa-user-circle {
    width: 38px; height: 38px;
    border: 1px solid var(--input-border-color, #ececec);
    border-radius: 50px;
    object-fit: cover;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--text-muted, #888888);
    line-height: 1;
}

/* 본문 */
.memo-body { flex: 1; min-width: 0; }

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1px;
}
.memo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.memo-name { font-weight: 700; font-size: 1.03em; color: var(--content-font-color, #333333); }
.memo-rank { font-size: 0.82em; font-weight: normal; }
.memo-category {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}
.memo-date { font-size: 0.78em; color: var(--text-muted, #888888); }

/* 수정/삭제 버튼 */
.memo-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    position: absolute;
    top: 10px; right: 16px;
}
.memo-edit-btn,
.memo-delete-btn {
    width: 26px; height: 26px;
    border: none;
    background: none;
    color: var(--text-muted, #888888);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.5px;
    transition: all 0.2s;
}
.memo-edit-btn:hover   { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: var(--primary-color, #7ba7c9); }
.memo-delete-btn:hover { background: rgba(220,50,50,0.08); color: var(--danger-color, #dc3232); }

/* 본문 텍스트 */
.memo-content {
    font-size: 0.98em;
    line-height: 1.6;
    color: var(--content-font-color, #333333);
    white-space: normal;
    word-break: break-word;
}


/* ============================================================
   EDIT AREA (글 수정 폼)
============================================================ */
.memo-edit-area { margin-top: 8px; }

.memo-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--input-border-color, #eee);
    background: #ffffff85;
    color: var(--content-font-color, #333333);
    font-size: 0.95em;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-edit-textarea:focus { border-bottom-color: var(--primary-color, #7ba7c9); }

.memo-edit-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* 공통: 저장/취소 */
.memo-save-btn,
.memo-cancel-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.memo-save-btn   { background: var(--primary-color, #7ba7c9); color: var(--btn-primary-text, #7a3f3a); margin-left: auto; }
.memo-cancel-btn { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: var(--text-muted, #888888); }
.memo-save-btn:hover   { filter: brightness(0.95); }
.memo-cancel-btn:hover { background: var(--card-border-color, rgba(255,255,255,0.4)); }


/* ============================================================
   ACTION BAR (좋아요 · 댓글)
============================================================ */
.memo-reply-section { margin-top: 8px; margin-bottom: 2px; }

.memo-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 좋아요 */
.memo-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 3px;
    border: none;
    background: none;
    color: var(--text-muted, #888888);
    font-size: 0.95em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}
.memo-like-btn:hover  { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: #e0245e; }
.memo-like-btn.liked  { color: #e0245e; }
.memo-like-btn.like-pop { transform: scale(1.3); }
.memo-like-btn .memo-like-count { font-weight: 700; }

/* 좋아요한 사람 */
.memo-liked-by {
    font-size: 0.78em;
    color: var(--text-muted, #888888);
    margin-top: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.memo-liked-by i      { color: #e0245e; font-size: 0.85em; }
.memo-liked-by strong { color: var(--content-font-color, #333333); }
.memo-liked-by:hover  { text-decoration: underline; }

/* 좋아요 목록 모달 */
.memo-liker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border-color, #eee);
    font-size: 0.9em;
}
.memo-liker-item:last-child { border-bottom: none; }
.memo-liker-item img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.memo-liker-item i   { font-size: 32px; color: var(--text-muted, #888888); }

/* 댓글 토글 */
.memo-reply-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 3px;
    border: none;
    background: none;
    color: var(--text-muted, #888888);
    font-size: 0.95em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}
.memo-reply-toggle:hover { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: var(--primary-color, #7ba7c9); }
.memo-reply-toggle .memo-reply-count { font-weight: 700; color: var(--primary-color, #7ba7c9); }


/* ============================================================
   REPLY AREA (댓글 목록)
============================================================ */
.memo-reply-area {
    margin-top: 5px;
    padding-top: 10px;
}
.memo-reply-loading {
    text-align: center;
    padding: 16px;
    color: var(--text-muted, #888888);
    font-size: 1.2em;
}
.memo-reply-empty,
.memo-reply-error {
    text-align: center;
    padding: 8px;
    color: var(--text-muted, #888888);
    font-size: 0.88em;
}
.memo-reply-error { color: var(--danger-color, #dc3232); }

/* 댓글 아이템 */
.memo-reply-item {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    position: relative;
}
.memo-reply-item:last-child { border-bottom: none; }
.memo-reply-item .memo-actions { top: 4px; right: 0; }

/* 댓글 아바타 */
.memo-reply-avatar {
    width: 32px; height: 32px;
    border-radius: 120px;
    overflow: hidden;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-reply-avatar img          { width: 100%; height: 100%; object-fit: cover; }
.memo-reply-avatar .fa-user-circle { font-size: 28px; color: var(--text-muted, #888888); line-height: 1; }

.memo-reply-body { flex: 1; min-width: 0; }

.memo-reply-content {
    font-size: 0.98em;
    line-height: 1.6;
    color: var(--content-font-color, #333333);
    word-break: break-word;
    margin-top: 4px;
}


/* ============================================================
   REPLY WRITE (댓글 쓰기 폼)
============================================================ */
.memo-reply-write {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 8px;
    padding-top: 5px;
}
.memo-reply-write-body { flex: 1; }

/* 댓글 아바타 (쓰기) */
.memo-reply-write-avatar {
    width: 30px; height: 30px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--light-bg-color, rgba(255,255,255,0.25));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.memo-reply-write-avatar img          { width: 100%; height: 100%; object-fit: cover; }
.memo-reply-write-avatar .fa-user-circle { font-size: 28px; color: var(--text-muted, #888888); line-height: 1; }

.memo-reply-input {
    width: 100%;
    min-height: 64px;
    padding: 4px 8px;
    border: 1px solid var(--input-border-color, #eee);
    background: #ffffff73;
    color: var(--content-font-color, #333333);
    font-size: 0.97em;
    line-height: 1.7;
    resize: none;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.memo-reply-input::placeholder { color: var(--text-muted, #888888); opacity: 0.7; }
.memo-reply-input:focus { border-bottom-color: var(--primary-color, #7ba7c9); }

.memo-reply-write-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.memo-reply-submit-btn {
    padding: 5px 16px;
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
    border: none;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}
.memo-reply-submit-btn:hover { filter: brightness(0.95); }


/* ============================================================
   EMPTY STATE
============================================================ */
.memo-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #888888);
}
.memo-empty i { font-size: 3em; display: block; margin-bottom: 16px; opacity: 0.3; }
.memo-empty p { font-size: 1em; margin: 6px 0; }
.memo-empty-hint { font-size: 0.9em; opacity: 0.7; }


/* ============================================================
   PAGINATION
============================================================ */
.bo-pagination { margin-top: 24px; text-align: center; }


/* ============================================================
   HASHTAG
============================================================ */
.memo-hashtag {
    color: var(--primary-color, #7ba7c9);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.memo-hashtag:hover { color: var(--accent-color, #7ba7c9); text-decoration: underline; }

/* 해시태그 필터 배너 */
.memo-tag-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin-bottom: 12px;
    background: rgba(91,141,238,0.1);
    border: 1px solid rgba(91,141,238,0.3);
    border-radius: 10px;
    font-size: 0.9em;
}
.memo-tag-banner-text { flex: 1; color: #5b8dee; font-weight: 600; }
.memo-tag-clear {
    background: none;
    border: 1px solid rgba(91,141,238,0.4);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.85em;
    color: #5b8dee;
    cursor: pointer;
    transition: background 0.15s;
}
.memo-tag-clear:hover { background: rgba(91,141,238,0.15); }


/* ============================================================
   SPOILER
============================================================ */
.memo-spoiler-wrap { margin-top: 8px; }

.memo-spoiler-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 5px 12px;
    background: rgba(120,120,180,0.1);
    border: 1px dashed rgba(120,120,180,0.4);
    border-radius: 6px;
    color: #888;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.memo-spoiler-toggle:hover { background: rgba(120,120,180,0.18); color: #555; }

.memo-spoiler-content {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(120,120,180,0.06);
    border-left: 3px solid rgba(120,120,180,0.3);
    border-radius: 0 6px 6px 0;
    font-size: 0.95em;
}


/* ============================================================
   BLOCK EDITOR
============================================================ */
.memo-block-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px ;
    min-height: 120px;
    border: 1px solid var(--input-border-color, #eee);
    border-radius: 16px;
    background-color : #ffffff82
}

.memo-block-editor:focus-within {
    border-color: var(--primary-color, #7ba7c9);
}

.memo-block-normal {
    min-height: 38px;
    outline: none;
    font-size: 0.97em;
    line-height: 1.7;
    color: var(--content-font-color, #333333);
    white-space: pre-wrap;
    word-break: break-word;
}
.memo-block-normal:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted, #bbb);
    pointer-events: none;
}

/* 스포일러 블록 */
.memo-block-spoiler {
    border: 1px dashed var(--card-border-color, #ddd);
    border-radius: 8px;
    overflow: hidden;
}
.memo-block-spoiler-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--light-bg-color, rgba(0,0,0,0.03));
}
.memo-block-spoiler-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 0.82em;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    text-align: left;
    transition: color 0.15s;
}
.memo-block-spoiler-toggle:hover { color: var(--text-color, #555); }
.memo-block-spoiler-remove {
    background: none;
    border: none;
    color: var(--text-muted, #ccc);
    font-size: 0.8em;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.memo-block-spoiler-remove:hover { color: var(--danger-color, #e55); }
.memo-block-spoiler-body {
    min-height: 36px;
    padding: 8px 12px;
    outline: none;
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--content-font-color, #333333);
    white-space: pre-wrap;
    word-break: break-word;
    border-top: 1px dashed var(--card-border-color, #ddd);
}
.memo-block-spoiler-body:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted, #bbb);
    pointer-events: none;
}


/* ============================================================
   LIGHTBOX
============================================================ */
#memo-lightbox { position: fixed; inset: 0; z-index: 9999; }
#memo-lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.88); cursor: pointer; }
#memo-lightbox-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#memo-lightbox-img-wrap {
    max-width: 90vw; max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}
#memo-lightbox-img {
    max-width: 90vw; max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    display: block;
}

/* 라이트박스 공통 버튼 */
#memo-lightbox-close,
#memo-lightbox-prev,
#memo-lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: background 0.15s;
}
#memo-lightbox-close:hover,
#memo-lightbox-prev:hover,
#memo-lightbox-next:hover { background: rgba(255,255,255,0.3); }

#memo-lightbox-close { top: 16px; right: 20px; width: 40px; height: 40px; font-size: 1.4em; }
#memo-lightbox-prev,
#memo-lightbox-next  { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 1.2em; }
#memo-lightbox-prev  { left: 16px; }
#memo-lightbox-next  { right: 16px; }

#memo-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
    pointer-events: none;
    background: rgba(0,0,0,0.4);
    padding: 3px 12px;
    border-radius: 20px;
}


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    #bo_list  { padding: 12px 8px; }
    #bo_sch   { justify-content: stretch; }
    #bo_sch form { width: 100%; }
    .memo-item       { padding: 14px; }
    .memo-write-area { padding: 14px; }
    .memo-img-grid.count-2 .memo-img-thumb              { height: 130px; }
    .memo-img-grid.count-3 .memo-img-thumb:first-child  { height: 150px; }
    .memo-img-grid.count-3 .memo-img-thumb:not(:first-child) { height: 100px; }
    .memo-img-grid.count-4 .memo-img-thumb              { height: 110px; }
}
/* ============================================================
   외부 이미지 URL 입력 행
   ============================================================ */
.memo-url-img-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    background: var(--bg-sub, #f5f5f5);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
    box-sizing: border-box;
    flex-wrap: nowrap;
}
.memo-url-img-text {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-color, #333);
    outline: none;
    padding: 2px 4px;
}
.memo-url-img-text::placeholder {
    color: var(--text-muted, #aaa);
    font-size: 12px;
}
.memo-url-img-add-btn {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color, #1d9bf0);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.memo-url-img-add-btn:hover {
    opacity: 0.85;
}
.memo-url-img-cancel-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
}
.memo-url-img-cancel-btn:hover {
    color: var(--text-color, #555);
}



/* ============================================================
   ▼ v3 추가 : 상단 바 · 알림 · 공지 · 대댓글 · 업로드 · 모바일
============================================================ */

/* 상단 바 (알림/로그인 + 검색) */
.memo-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}
.memo-topbar #bo_sch {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.memo-login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 알림 */
.memo-noti { position: relative; flex-shrink: 0; }
.memo-noti-btn {
    position: relative;
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--card-bg-color, rgba(255,255,255,0.75));
    color: var(--text-muted, #888);
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: color 0.15s;
}
.memo-noti-btn:hover { color: var(--primary-color, #7ba7c9); }
.memo-noti-btn .fas.fa-bell { color: var(--primary-color, #7ba7c9); }
.memo-noti-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e0245e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
}
.memo-noti-panel {
    position: absolute;
    top: 46px; left: 0;
    width: 320px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: var(--card-bg-color, #fff);
    background-color: var(--form-bg-color, #fff);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    z-index: 1000;
    overflow: hidden;
}
.memo-noti-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-border-color, #eee);
}
.memo-noti-head strong { flex: 1; font-size: 0.95em; color: var(--content-font-color, #333); }
.memo-noti-readall,
.memo-noti-close {
    background: none;
    border: none;
    color: var(--text-muted, #888);
    font-size: 0.8em;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.memo-noti-readall:hover,
.memo-noti-close:hover { color: var(--primary-color, #7ba7c9); }
.memo-noti-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.memo-noti-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 0.88em;
}
.memo-noti-item {
    display: flex;
    gap: 10px;
    padding: 11px 14px;
    text-decoration: none;
    color: var(--content-font-color, #333);
    border-bottom: 1px solid var(--card-border-color, #f0f0f0);
    font-size: 0.87em;
    line-height: 1.45;
}
.memo-noti-item:last-child { border-bottom: none; }
.memo-noti-item:hover { background: var(--light-bg-color, rgba(0,0,0,0.03)); }
.memo-noti-item.unread { background: rgba(123,167,201,0.12); }
.memo-noti-icon { color: var(--primary-color, #7ba7c9); margin-top: 3px; flex-shrink: 0; width: 16px; text-align: center; }
.memo-noti-text { flex: 1; min-width: 0; }
.memo-noti-preview {
    margin-top: 2px;
    color: var(--text-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.memo-noti-time { margin-top: 2px; font-size: 0.85em; color: var(--text-muted, #aaa); }

/* 공지 */
.memo-notice-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 20px;
}
/* 공지 카드 접기 */
.memo-fold-btn {
    width: 26px; height: 26px;
    border: none;
    background: none;
    color: var(--text-muted, #888888);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.memo-fold-btn:hover { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: var(--primary-color, #7ba7c9); }
.memo-fold-preview {
    display: none;
    margin-top: 4px;
    padding-right: 8px;
    color: var(--text-muted, #888888);
    font-size: 0.92em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.memo-item.memo-folded .memo-fold-preview { display: block; }
.memo-notice-area .memo-meta { padding-right: 34px; }  /* 접기 버튼 자리 */
.memo-item.memo-folded .memo-content,
.memo-item.memo-folded .memo-secret-placeholder,
.memo-item.memo-folded .memo-reply-section,
.memo-item.memo-folded .memo-thread-line { display: none !important; }
.memo-notice-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-color, #7ba7c9);
    color: var(--btn-primary-text, #7a3f3a);
    font-size: 0.75em;
    font-weight: 700;
}
.memo-notice-badge i { font-size: 0.9em; }

/* 공지 버튼 (글쓰기 툴바 · 글 액션) */
.memo-notice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 8px;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 0.9em;
    transition: color 0.15s, background 0.15s;
}
.memo-notice-btn:hover { background: var(--light-bg-color, rgba(255,255,255,0.25)); }
.memo-notice-btn.active { color: var(--primary-color, #7ba7c9); }
.memo-notice-btn.active i { transform: rotate(-30deg); }
.memo-pin-btn {
    width: 26px; height: 26px;
    border: none;
    background: none;
    color: var(--text-muted, #888888);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.5px;
    transition: all 0.2s;
}
.memo-pin-btn:hover  { background: var(--light-bg-color, rgba(255,255,255,0.25)); color: var(--primary-color, #7ba7c9); }
.memo-pin-btn.active { color: var(--primary-color, #7ba7c9); }
.memo-pin-btn.active i { transform: rotate(-30deg); }

/* 단일 글 보기 배너 */
.memo-thread-banner { margin: 0 0 12px; }
.memo-thread-banner a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--card-bg-color, rgba(255,255,255,0.75));
    color: var(--text-muted, #888);
    font-size: 0.88em;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.memo-thread-banner a:hover { color: var(--primary-color, #7ba7c9); }

/* 대댓글 */
.memo-reply-to {
    margin-top: 2px;
    font-size: 0.8em;
    color: var(--text-muted, #888);
}
.memo-reply-to i { font-size: 0.85em; margin-right: 2px; }
.memo-reply-to span { color: var(--primary-color, #7ba7c9); font-weight: 600; }
.memo-reply-foot { margin-top: 1px; }
.memo-reply-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    margin-left: -6px;
    border: none;
    background: none;
    color: var(--text-muted, #888);
    font-size: 0.78em;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.memo-reply-reply-btn:hover { color: var(--primary-color, #7ba7c9); background: var(--light-bg-color, rgba(255,255,255,0.25)); }
.memo-reply-children:empty { display: none; }
.memo-reply-children {
    margin-top: 2px;
    padding-left: 2px;
}
.memo-reply-item.memo-reply-child { padding: 4px 0; }
.memo-reply-child .memo-reply-avatar { width: 26px; height: 26px; }
.memo-reply-main { border-radius: 8px; }
.memo-reply-main.memo-hl { animation: memoHl 2.6s ease-out; }
@keyframes memoHl {
    0%, 35% { background: rgba(255, 205, 80, 0.35); box-shadow: 0 0 0 6px rgba(255, 205, 80, 0.35); }
    100%    { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.memo-reply-target {
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    padding: 4px 6px 4px 10px;
    border-radius: 8px;
    background: var(--light-bg-color, rgba(0,0,0,0.04));
    color: var(--primary-color, #7ba7c9);
    font-size: 0.82em;
    font-weight: 600;
}
.memo-reply-target-name { margin-right: -2px; }
.memo-reply-target-cancel {
    margin-left: auto;
    width: 24px; height: 24px;
    border: none;
    background: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 6px;
}
.memo-reply-target-cancel:hover { color: var(--danger-color, #dc3232); }

/* 업로드 중 표시 */
.memo-img-uploading {
    width: 80px; height: 80px;
    border-radius: 10px;
    border: 1px dashed var(--card-border-color, #ddd);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #888);
    background: var(--light-bg-color, rgba(255,255,255,0.25));
}
.memo-reply-img-preview-area .memo-img-uploading,
.memo-reply-edit-img-preview .memo-img-uploading { width: 60px; height: 60px; }
.memo-reply-edit-img-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
}
.memo-reply-edit-img-preview .memo-img-preview-item { width: 60px; height: 60px; }

/* 모바일 플로팅 버튼 (기본 숨김) */
.memo-fab { display: none; }

/* 터치 기기: 더블탭 확대 지연 제거 + hover 고정 방지 */
#bo_list button,
#bo_list label,
#bo_list a { touch-action: manipulation; }
@media (hover: none) {
    .memo-item:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    }
}

@media (max-width: 768px) {
    .memo-topbar #bo_sch form { width: 100%; }

    /* iOS 입력칸 포커스 시 화면 확대 방지 (16px 미만이면 확대됨) */
    .memo-block-normal,
    .memo-block-spoiler-body,
    .memo-reply-input,
    .memo-edit-textarea,
    .memo-url-img-text,
    .memo-select,
    #bo_sch input,
    #bo_sch select { font-size: 16px; }

    /* 손가락으로 누르기 편한 크기 */
    .memo-img-btn,
    .memo-secret-btn,
    .memo-url-img-btn,
    .memo-reply-spoiler-btn,
    .memo-notice-btn { width: 36px; height: 36px; }
    .memo-spoiler-btn { min-width: 36px; height: 36px; }
    .memo-edit-btn,
    .memo-delete-btn,
    .memo-pin-btn { width: 32px; height: 32px; margin-top: 0; }
    .memo-actions { top: 8px; right: 10px; gap: 2px; }
    .memo-reply-toggle,
    .memo-like-btn { padding: 6px 8px; }
    .memo-action-bar { gap: 4px; margin-left: -6px; }
    .memo-reply-reply-btn { padding: 6px 8px; }

    .memo-write-footer { flex-wrap: wrap; }
    .memo-write-footer .memo-url-img-row { order: 10; }
    .memo-reply-write-footer { flex-wrap: wrap; }
    .memo-reply-write-footer .memo-url-img-row { order: 10; }
    .memo-reply-write { gap: 8px; }
    .memo-reply-children { padding-left: 0; }

    .memo-fold-btn { width: 32px; height: 32px; }

    /* 알림 패널: 화면 아래쪽 시트 형태 */
    .memo-noti-panel {
        position: fixed;
        top: auto; left: 8px; right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-height: 70vh;
        border-radius: 18px;
    }
    .memo-noti-item { padding: 13px 14px; }
    .memo-noti-readall,
    .memo-noti-close { padding: 8px 10px; font-size: 0.85em; }

    /* 플로팅 버튼 */
    .memo-fab {
        display: flex;
        position: fixed;
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        width: 52px; height: 52px;
        border: none;
        border-radius: 50%;
        background: var(--primary-color, #7ba7c9);
        color: var(--btn-primary-text, #7a3f3a);
        font-size: 1.15em;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
        z-index: 900;
        opacity: 0;
        pointer-events: none;
        transform: translateY(12px);
        transition: opacity 0.2s, transform 0.2s;
    }
    .memo-fab.show { opacity: 1; pointer-events: auto; transform: none; }
    body.memo-noti-open .memo-fab { opacity: 0; pointer-events: none; }

    /* 라이트박스 버튼 노치 영역 피하기 */
    #memo-lightbox-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
    #memo-lightbox-counter { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
