@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --bg-main: #f5f5f7;
    --panel-bg: #ffffff;
    --section-bg: #f5f5f7;
    --input-bg: #ffffff;
    --border-color: #e5e5ea;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --primary: #007aff;
    --primary-hover: #006ce6;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Pretendard', sans-serif; }
body { background-color: var(--bg-main); display: flex; height: 100vh; overflow: hidden; color: var(--text-main); }

/* 스크롤바 커스텀 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #aeaeb2; }

/* 왼쪽 에디터 패널 */
.editor-panel { width: 480px; background: var(--panel-bg); display: flex; flex-direction: column; overflow-y: auto; z-index: 10; border-right: 1px solid var(--border-color); box-shadow: 4px 0 24px rgba(0,0,0,0.02); }

.editor-header { padding: 28px 32px 20px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.header-titles h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.header-titles p { font-size: 0.85rem; color: var(--text-muted); }

.btn-guide-toggle { background: none; border: none; font-size: 1.2rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.btn-guide-toggle:hover { color: var(--primary); }

.editor-body { padding: 24px 32px; display: flex; flex-direction: column; gap: 24px; }

.guide-box { 
    background: var(--panel-bg); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-md); 
    padding: 20px 24px; 
    font-size: 0.85rem; 
    color: var(--text-main); 
    line-height: 1.6; 
    box-shadow: var(--shadow-sm); 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    transition: all 0.3s ease;
}
.guide-box.hidden { display: none; }

.guide-title { font-size: 0.95rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.guide-box ol, .guide-box ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-muted); }
.guide-box li strong { color: var(--text-main); }
.guide-box code { background: var(--bg-main); padding: 2px 6px; border-radius: 4px; color: #006ce6; font-size: 0.8rem; }

.guide-divider { width: 100%; height: 1px; background-color: var(--border-color); border-radius: 1px; }

.guide-section.caution .guide-title strong { color: #ef4444; }

.editor-section { background: var(--section-bg); border-radius: var(--radius-lg); padding: 24px; }
.section-title-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 0;}
.editor-section > .section-title { margin-bottom: 16px; }
.icon-muted { color: var(--text-muted); font-size: 1.1rem; }

/* 입력 폼 공통 */
.input-group { display: flex; flex-direction: column; gap: 12px; }
.row-inputs { display: flex; gap: 12px; align-items: center; }
.styled-input, .styled-input-sm { width: 100%; border: 1.5px solid transparent; background: var(--input-bg); color: var(--text-main); outline: none; transition: all 0.2s ease; box-shadow: var(--shadow-sm); }
.styled-input { padding: 14px 16px; border-radius: var(--radius-md); font-size: 0.95rem; }
.styled-input-sm { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.85rem; }
.styled-input:focus, .styled-input-sm:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); }
.styled-input::placeholder, .styled-input-sm::placeholder { color: #a1a1aa; }
textarea.styled-input { resize: vertical; min-height: 80px; }

/* 파일 업로드 버튼 */
.upload-row { display: flex; gap: 8px; align-items: center; width: 100%; }
.btn-icon-upload { width: 48px; height: 48px; flex-shrink: 0; background: var(--input-bg); border-radius: var(--radius-md); color: var(--text-muted); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; box-shadow: var(--shadow-sm); font-size: 1.1rem; }
.btn-icon-upload:hover { color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* 토글 스위치 디자인 */
.toggle-switch { position: relative; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: relative; width: 36px; height: 20px; background-color: #d1d1d6; border-radius: 20px; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; border-radius: 50%; transition: .3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); }

/* 라디오 버튼 */
.like-type-selector { display: flex; gap: 16px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); padding: 4px 2px; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-label input { accent-color: var(--primary); width: 16px; height: 16px; }

/* 댓글 에디터 컨테이너 */
.comment-edit-box { background: var(--panel-bg); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.reply-edit-box { background: var(--section-bg); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.comment-edit-options { display: flex; gap: 12px; align-items: center; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; font-weight: 600; margin-top: 2px; }
.comment-edit-options label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.comment-edit-options input[type="checkbox"] { accent-color: var(--primary); }

.btn-small { padding: 6px 12px; font-size: 0.75rem; border-radius: 20px; border: none; cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-add-reply { background: var(--border-color); color: var(--text-main); }
.btn-add-reply:hover { background: #d1d1d6; }
.btn-delete { background: #fee2e2; color: #ef4444; }
.btn-delete:hover { background: #fca5a5; }

.btn-add-comment { background: transparent; color: var(--primary); padding: 14px; border-radius: var(--radius-md); border: 1.5px dashed #bae6fd; cursor: pointer; font-weight: 700; width: 100%; transition: 0.2s; font-size: 0.9rem; margin-top: 8px; }
.btn-add-comment:hover { background: #f0f9ff; border-color: var(--primary); }

/* 세팅 에어리어 */
.setup-area { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #fff; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.setup-info { display: flex; flex-direction: column; gap: 2px; }
.setup-label { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.setup-desc { font-size: 0.75rem; color: var(--text-muted); }
.setup-actions { display: flex; gap: 8px; }
.btn-tiny { padding: 8px 14px; border: none; border-radius: 8px; background: var(--section-bg); color: var(--text-main); font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-tiny:hover { background: var(--border-color); }
.color-css { color: #2980b9; }
.color-js { color: #f39c12; }

/* 액션 푸터 */
.action-footer { position: sticky; bottom: 0; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 20px 32px 32px; border-top: 1px solid var(--border-color); z-index: 20; }
.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { padding: 16px; border: none; border-radius: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 0.95rem; }
.btn:active { transform: scale(0.98); }
.btn-html { background: var(--text-main); color: #fff; box-shadow: 0 4px 12px rgba(29, 29, 31, 0.15); }
.btn-html:hover { background: #000; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.btn-download { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2); }
.btn-download:hover { background: var(--primary-hover); box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3); }
#copy-msg { font-size: 0.8rem; font-weight: 600; color: var(--primary); text-align: center; margin-top: 12px; min-height: 16px; }

/* 오른쪽 미리보기 패널 */
.preview-panel { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 60px 40px; overflow-y: auto; background-image: radial-gradient(#d1d1d6 1px, transparent 1px); background-size: 24px 24px; }

/* 카드 스타일 */
.sns-post-preview { width: 100%; max-width: 480px; background: #fff; border: 1px solid #eaeaea; border-radius: 20px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.06); text-align: left; line-height: 1.5; color: #111; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', sans-serif;}
.sns-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; }
.sns-profile { display: flex; align-items: center; gap: 12px; }
.sns-avatar-ring { width: 42px; height: 42px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.sns-avatar-ring.active { background: linear-gradient(to bottom left, #d92e7f, #f58529); padding: 2px; }
.sns-avatar-box { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; background-color: #f5f5f5; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.sns-avatar-box img { width: 100%; height: 100%; object-fit: cover; border: 1px solid #d9d9d9; border-radius: 50%; }
.sns-info { display: flex; flex-direction: column; }
.sns-name { font-weight: 600; font-size: 0.95rem; color: #111; margin: 0; }
.sns-music-container { font-size: 0.8rem; color: #111; display: flex; align-items: center; gap: 8px; font-weight: 400; }
.sns-more { background: none; border: none; font-size: 1.2rem; color: #111; cursor: pointer; }
.sns-img-box { width: 100%; aspect-ratio: 1 / 1; background-color: #fafafa; overflow: hidden; display: flex; justify-content: center; align-items: center; border-top: 1px solid #fafafa; border-bottom: 1px solid #fafafa;}
.sns-img-box img { width: 100%; height: 100%; object-fit: cover; }
.sns-body { padding: 16px 16px 20px; }
.sns-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sns-actions-left { display: flex; align-items: center; gap: 18px; }
.sns-actions-left button, .sns-action-btn-right { background: none; border: none; font-size: 1.7rem; color: #111; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 6px; margin-right: 0; transition: transform 0.1s;}
.sns-actions-left button:active, .sns-action-btn-right:active { transform: scale(0.9); opacity: 0.6; }
.sns-action-count { font-size: 1rem; font-weight: 600; color: #111; }
.sns-likes { font-weight: 400; font-size: 0.95rem; margin-bottom: 3px; color: #111; }
.sns-likes strong { font-weight: 600; }
.sns-content { font-size: 0.95rem; color: #111; white-space: pre-wrap; word-break: break-all; }
.sns-content strong { font-weight: 600; margin-right: 3px; }
.sns-time { font-size: 0.75rem; color: #888; margin-top: 10px; font-weight: 500;}
.sns-comments-area { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; border-top: 1px solid #f0f0f0; padding-top: 16px; }
.sns-comment-wrap { display: flex; flex-direction: column; gap: 12px; }
.sns-comment-row { display: flex; gap: 12px; align-items: flex-start; }
.sns-c-avatar-wrap { position: relative; flex-shrink: 0; padding-top: 4px; }
.sns-c-avatar-box { width: 42px; height: 42px; border-radius: 50%; background-color: #f5f5f5; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); overflow: hidden; display: flex; justify-content: center; align-items: center; }
.sns-c-avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.reply-avatar-box { width: 38px; height: 38px; }
.sns-author-liked-badge { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #eaeaea; background-color: #fff; overflow: hidden; display: inline-block; vertical-align: middle; }
.sns-author-liked-badge img { width: 100%; height: 100%; object-fit: cover; }
.sns-author-liked-badge span.fa-heart { position: absolute; top: 50%; right: -5px; transform: translateY(-50%); font-size: 9px; color: #ff4757; border-radius: 50%; padding: 1px; box-shadow: 0 0 2px rgba(0,0,0,0.1); z-index: 10; }
.sns-c-main { flex: 1; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.sns-c-header { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; flex-wrap: wrap; }
.sns-c-name { font-weight: 600; color: #111; }
.sns-c-time { color: #888; font-size: 0.75rem; }
.sns-c-isauthor { color: #888; font-size: 0.75rem; }
.sns-c-text { font-size: 0.9rem; color: #111; line-height: 1.4; }
.sns-c-actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.sns-c-reply-btn, .sns-c-share-btn { background: none; border: none; font-size: 0.8rem; font-weight: 600; color: #888; cursor: pointer; padding: 0; }
.sns-c-right { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; flex-shrink: 0; width: 24px; }
.sns-c-right span.fa-heart { font-size: 1.1rem; color: #888; cursor: pointer; }
.sns-c-like-cnt { font-size: 0.7rem; color: #888; font-weight: 600; }
.sns-replies-container { margin-left: 48px; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.sns-more-replies { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 4px; }
.reply-line { width: 30px; height: 1px; background: #888; }
.sns-more-replies span { font-size: 0.8rem; font-weight: 600; color: #888; }
.sns-hidden-replies { display: none; flex-direction: column; gap: 12px; margin-top: 12px; }
.sns-hidden-replies.active { display: flex !important; }
.sns-highlight { color: #3743CB; }