/* ============================================================
   대영빌라 305호 - 기본 스타일 (뼈대용)
   여기 색깔/폰트/크기를 바꾸면 사이트 전체 디자인이 바뀝니다.
   나중에 마음껏 예쁘게 꾸며보세요! 🎨
   ============================================================ */

/* ===== 웹폰트 (assets/fonts/ 에서 불러옴) ===== */
/* 손글씨: 규상(KCC임권택체) / 하나(온글잎 박다현체) */
@font-face {
    font-family: 'KCC임권택체';
    src: url('fonts/imkwontaek.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: '온글잎 박다현체';
    src: url('fonts/onglyph-parkdahyeon.woff2') format('woff2');
    font-display: swap;
}
/* 본문 대체용: 북크크명조 (Light=일반, Bold=굵게) */
@font-face {
    font-family: '북크크명조';
    src: url('fonts/BookkMyungjo_Light.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}
@font-face {
    font-family: '북크크명조';
    src: url('fonts/BookkMyungjo_Bold.woff2') format('woff2');
    font-weight: bold;
    font-display: swap;
}
/* 노토산스 KR (가변폰트 — 굵기 100~900 전부 지원) */
@font-face {
    font-family: '노토산스';
    src: url('fonts/NotoSansKR-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}
/* UI용: Pretendard (애플 산돌고딕st, 가변폰트) */
@font-face {
    font-family: 'Pretendard';
    src: url('fonts/PretendardVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

/* --- 자주 바꾸는 값들을 여기 모아뒀어요 --- */
/* ============================================================
   🥛 딸기우유 느와르 — 지하실 먹색 + 딸기우유 핑크
   색은 딱 두 갈래만: 어두운 회색 계열 + 핑크. 그 외 색은 안 씀.
   ============================================================ */
:root {
    --page: #17171a;        /* 페이지 바탕 — 지하실 먹색 */
    --card: #202024;        /* 카드/박스 */
    --card-2: #26262b;      /* 한 겹 위 (입력창·표머리·호버) */
    --bg: #26262b;          /* 옅은 바탕 (호버 등) — 기존 이름 유지 */
    --line: #34343a;        /* 구분선 */
    --text: #f2ede7;        /* 기본 글자 (크림) */
    --sub: #8e8e97;         /* 옅은 글자 (날짜 등) */

    --point: #f8b4c4;       /* 포인트 = 딸기우유 핑크 */
    --point-dark: #ffcbd8;  /* 마우스 올렸을 때 더 밝게 */
    --accent: #f8b4c4;      /* 위와 동일 (의미상 별칭) */
    --accent-deep: #e0447a; /* 네온 글로우용 진한 핑크 */
    --accent-soft: rgba(248,180,196,0.13);
    --on-accent: #2b1a1f;   /* 핑크 위에 올라가는 글자색 */

    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--page);   /* 종이색 바탕 → 흰 카드가 카드로 보임 */
    color: var(--text);
    font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    line-height: 1.7;
}

/* 어두운 바탕에서 카드가 구분되게 테두리 */
.post, .post-item, .comment, .feed-card, .playlist-card, .thumb-row,
.login-box, .cat-add, .cat-list, .admin-table, .gallery-item, .sub-nav a {
    border: 1px solid var(--line);
}

a { color: var(--point); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 스크롤바도 어둡게 (흰 줄 남지 않게) */
html { color-scheme: dark; }

/* 🥛 커서 = 딸기우유 팩 (글 쓰는 칸에서는 원래 커서 유지) */
body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='30'%3E%3Cpath d='M6 9 L13 3 L20 9 L20 27 L6 27 Z' fill='%23fdfbf8' stroke='%23e0447a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Crect x='6' y='15' width='14' height='6.5' fill='%23f8b4c4'/%3E%3Cpath d='M6 9 L13 3 L20 9' fill='none' stroke='%23e0447a' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto;
}
a, button, .sticker, [data-pop], summary, label { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='30'%3E%3Cpath d='M6 9 L13 3 L20 9 L20 27 L6 27 Z' fill='%23f8b4c4' stroke='%23e0447a' stroke-width='1.6' stroke-linejoin='round'/%3E%3Crect x='6' y='15' width='14' height='6.5' fill='%23fdfbf8'/%3E%3C/svg%3E") 4 3, pointer; }
input, textarea, select, .note-editable { cursor: auto; }
input[type="text"], input[type="password"], textarea { cursor: text; }

/* --- 상단 헤더 / 메뉴 --- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 20px 30px;
}
.site-title { margin: 0 0 12px; font-size: 24px; }
.site-title a { color: var(--text); }
.site-nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 15px; }
.site-nav .nav-right { margin-left: auto; display: flex; gap: 14px; }

/* --- 본문 영역 --- */
.site-main {
    max-width: 820px;
    margin: 64px auto 40px;   /* 좌상단 ☰ 버튼 아래로 내용이 오게 */
    padding: 0 20px;
}
/* 제목 — 회색 막대 대신 사이드바와 같은 빨간 점으로 (톤 통일) */
.page-title {
    font-size: 21px; letter-spacing: -0.01em;
    border-left: 0; padding-left: 0;
    display: flex; align-items: center; gap: 9px;
}
.page-title::before {
    content: ''; flex: 0 0 auto;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 10px var(--accent-deep);
}
.empty { color: var(--sub); }

/* --- 글 목록 --- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--card);
    padding: 15px 18px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    position: relative;   /* 박스 전체 클릭용 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.post-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(248,180,196,0.18);
    transform: translateY(-2px);
}
.post-item:hover .post-link { color: var(--accent); }
.post-link::after { content: ''; position: absolute; inset: 0; }   /* 링크를 박스 전체로 확장 */
.post-cat { color: var(--accent); font-weight: bold; font-size: 13px; margin-right: 6px; }
.post-date { color: var(--sub); font-size: 13px; white-space: nowrap; }
.post-link { color: var(--text); }

/* --- 글 읽기 --- */
.post {
    background: var(--card);
    padding: 34px 36px;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.post .post-title { font-size: 25px; margin: 6px 0; border: 0; padding: 0; line-height: 1.4; }
.post .post-date { display: block; margin-bottom: 6px; }

/* 작성일시 + 연필버튼 한 줄에 */
.post-datebar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.post-datebar .post-date { margin-bottom: 0; }

/* 뷰어용 글자크기/행간 조절 — 연필 아이콘 눌러야 나옴 */
.reader-tools {
    position: relative; display: flex; justify-content: flex-end;
    color: var(--sub); font-size: 12px;
}
.reader-tools .rt-toggle {
    width: 30px; height: 30px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; color: var(--sub);
    border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.reader-tools .rt-toggle:hover { background: var(--bg); color: var(--text); }
.rt-panel {
    display: none; position: absolute; top: 36px; right: 0; z-index: 6;
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1); padding: 8px 10px;
    align-items: center; gap: 6px;
}
.rt-panel.open { display: flex; }
.reader-tools .rt-label { font-size: 12px; }
.reader-tools .rt-sep { width: 1px; height: 15px; background: var(--line); margin: 0 3px; }
.reader-tools button {
    width: 26px; height: 26px; padding: 0;
    background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: 6px;
    font-size: 14px; font-weight: bold; cursor: pointer; line-height: 1;
}
.reader-tools button:hover { background: var(--bg); }
.reader-tools .rt-reset { width: auto; padding: 0 10px; font-weight: normal; font-size: 12px; }

/* 본문 — 긴 글 읽기 편하게 */
.post-content {
    border-top: 1px solid var(--line);
    padding-top: 26px;
    font-family: '북크크명조', 'Malgun Gothic', serif;   /* 본문 읽기는 명조체 유지 */
    font-size: 17px;          /* 뷰어가 조절하면 이 값이 바뀜 */
    line-height: 1.9;         /* 뷰어가 조절하면 이 값이 바뀜 */
    color: #e8e2db;           /* 순백보다 살짝 낮춰 긴 글 읽을 때 눈부심 줄임 */
    overflow-wrap: break-word;
}
/* 소설식 첫 줄 들여쓰기 + 문단 간격 일관되게.
   !important 로 붙여넣은 글에 딸려온 제멋대로 여백/들여쓰기를 눌러 통일함.
   에디터(.note-editable)에도 똑같이 적용해서 쓸 때 보이는 대로 나옴(WYSIWYG). */
.post-content p,
.note-editable p {
    margin: 0 0 1.15em !important;
    text-indent: 1em !important;
    padding-left: 0 !important;
}
/* 단, 가운데/오른쪽 정렬한 문단은 들여쓰기 빼기 */
.post-content p[style*="text-align: center"],  .note-editable p[style*="text-align: center"],
.post-content p[style*="text-align:center"],   .note-editable p[style*="text-align:center"],
.post-content p[style*="text-align: right"],   .note-editable p[style*="text-align: right"],
.post-content p[style*="text-align:right"],    .note-editable p[style*="text-align:right"],
.post-content p[data-mce-style*="text-align: center"],
.post-content p[data-mce-style*="text-align: right"] { text-indent: 0 !important; }
/* 말풍선 안 문단은 들여쓰기 없음 */
.chat-bubble p { text-indent: 0 !important; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 6px 0; }
.post-content a { text-decoration: underline; text-underline-offset: 2px; }
.post-content blockquote {
    margin: 1.4em 0; padding: 10px 18px;
    border-left: 3px solid var(--point);
    background: var(--card-2); color: #c9c3bd; border-radius: 0 6px 6px 0;
}
.post-content h1, .post-content h2, .post-content h3 { line-height: 1.4; margin: 1.5em 0 .6em; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
/* 📄 종이 모드 — 긴 글 읽을 때 눈 편하게 (연필 버튼에서 전환, 브라우저에 기억됨) */
body.paper-mode .post { background: #f4efe6; border-color: #e2dacb; box-shadow: 0 2px 14px rgba(0,0,0,0.35); }
body.paper-mode .post .post-title { color: #241f1a; }
body.paper-mode .post .post-date,
body.paper-mode .post .post-cat a { color: #7a7267; }
body.paper-mode .post-content { color: #2b2822; border-top-color: #e2dacb; }
body.paper-mode .post-content blockquote { background: #eae2d3; color: #55504a; }
body.paper-mode .post-content hr { border-top-color: #e2dacb; }
body.paper-mode .chat-bubble.left { background: #e7e2d8; }
body.paper-mode .chat-bubble.right { background: #ded3d6; }
body.paper-mode .chat-bubble { color: #2b2822; }
body.paper-mode .reader-tools .rt-toggle { border-color: #d8cfc0; color: #7a7267; }

.post-actions { margin-top: 28px; text-align: right; }
.post-actions a { margin-left: 12px; }

/* --- 댓글 --- */
.comments { margin-top: 30px; }
.comment {
    background: var(--card);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.comment-head { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.comment-name { font-weight: bold; }
.comment-date { color: var(--sub); }
.comment-del { color: #d9534f; margin-left: auto; }
.comment-body { margin: 6px 0 0; }

.comment-form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

/* --- 입력창 / 버튼 공통 --- */
input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    background: var(--card-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
}
input::placeholder, textarea::placeholder { color: #6f6f78; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 주요 동작(저장·남기기 등) = 채워진 핑크 */
button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.18s, box-shadow 0.18s;
}
button:hover { background: var(--point-dark); box-shadow: 0 0 16px rgba(248,180,196,0.28); }

/* 링크형 버튼 = 테두리형, 올리면 핑크로 켜짐 (네온 느낌) */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--card-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    font-size: 15px;
    transition: all 0.22s;
}
.btn:hover {
    background: var(--card-2);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 14px rgba(248,180,196,0.22);
    transform: translateY(-1px);
    text-decoration: none;
}

/* --- 로그인 박스 --- */
.login-box {
    max-width: 340px; margin: 40px auto; text-align: center;
    background: var(--card); padding: 30px; border-radius: var(--radius);
}
.login-box input { margin: 8px 0; }
.login-box button { width: 100%; margin-top: 10px; }

/* --- 글쓰기 폼 --- */
.write-form label { display: block; margin: 16px 0 6px; font-weight: bold; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; }

/* --- 관리 테이블 --- */
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
.admin-table thead th { background: var(--card-2); color: var(--point-dark); font-size: 12.5px; letter-spacing: .02em; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--card-2); }
.admin-table td.nowrap { white-space: nowrap; color: var(--sub); }
.admin-table td a { color: var(--text); }
.admin-table td a:hover { color: var(--point); }
.admin-table .empty { text-align: center; color: var(--sub); padding: 28px; }
.table-actions a { margin-right: 10px; font-size: 13px; color: var(--sub); }
.table-actions a:hover { color: var(--point); }
.cmt-zero { color: #c4c4cc; font-size: 13px; }

/* 순서(▲▼) 조절 칸 */
.admin-table .ord-col { width: 44px; }
.ord-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; }
.ord-cell a {
    display: block; width: 22px; text-align: center; font-size: 11px;
    color: var(--sub); border: 1px solid var(--line); border-radius: 5px;
    padding: 2px 0; background: var(--card-2);
}
.ord-cell a:hover { color: #fff; background: var(--point); border-color: var(--point); text-decoration: none; }

/* --- 메뉴 드롭다운 (대분류에 마우스 올리면 소분류 펼침) --- */
.nav-group { position: relative; display: inline-block; }
.nav-dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 10;
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 6px 0; min-width: 130px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nav-group:hover .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 6px 16px; white-space: nowrap; }
.nav-dropdown a:hover { background: var(--bg); text-decoration: none; }

/* --- 카테고리 페이지 안의 소분류 부제 메뉴 --- */
.sub-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; font-size: 14px; }
.sub-nav a { padding: 4px 12px; background: var(--card); border-radius: 20px; }

/* --- 관리실: 툴바 / 글 관리 --- */
.admin-toolbar { display: flex; gap: 10px; }
.btn-sub { background: var(--card); color: var(--sub); }
.btn-sub:hover { color: var(--accent); }

.admin-tools {
    display: flex; flex-wrap: wrap; gap: 8px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 22px;
}
.admin-tools .btn { font-size: 13.5px; }

.admin-postbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.admin-h3 { font-size: 16px; margin: 0; }
.admin-filter select {
    font-size: 13.5px; padding: 7px 30px 7px 12px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'><path d='M1 1l4 4 4-4' stroke='%2357575d' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>") no-repeat right 11px center;
    color: var(--text); cursor: pointer; -webkit-appearance: none; appearance: none;
}
.admin-filter select:focus { outline: none; border-color: var(--point); }
.admin-hint { color: var(--sub); font-size: 12.5px; margin: 0 0 12px; }
.admin-hint b { color: var(--point-dark); }

/* --- 카테고리 관리 화면 --- */
.cat-help { color: var(--sub); font-size: 14px; }
.cat-add {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    background: var(--card); padding: 14px; border-radius: var(--radius); margin-bottom: 20px;
}
.cat-add input[type="text"] { flex: 1; min-width: 160px; }
.cat-add select { width: auto; }
.cat-add button { white-space: nowrap; }

.cat-list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.cat-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.cat-row:last-child { border-bottom: 0; }
.cat-child { padding-left: 34px; background: var(--card-2); }
.cat-branch { color: var(--sub); }
.cat-rename { display: flex; align-items: center; gap: 6px; flex: 1; }
.cat-rename input[type="text"] { width: auto; flex: 1; max-width: 260px; padding: 6px 10px; }
.cat-rename button { padding: 6px 10px; font-size: 14px; }
.cat-count { color: var(--sub); font-size: 13px; white-space: nowrap; }
.cat-tools { display: flex; gap: 10px; align-items: center; font-size: 14px; white-space: nowrap; }
.cat-tools a { color: var(--point); }
.cat-del { color: #d9534f !important; }

/* --- 글쓰기 도구 (넓게 토글 / 팁) --- */
.write-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.write-tools button { padding: 6px 12px; font-size: 13px; }
.write-tip { color: var(--sub); font-size: 13px; }

/* 임시저장 바 */
.draft-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.draft-bar button {
    font-size: 13px; padding: 6px 12px; background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.draft-bar button:hover { border-color: var(--point); color: var(--point); }
.draft-bar #draftSave { background: var(--point); color: #fff; border-color: var(--point); }
.draft-bar #draftSave:hover { background: var(--point-dark); color: #fff; }
.draft-status { font-size: 12px; color: var(--sub); }

/* 넓게 쓰기 모드 (버튼으로 켜고 끔) */
.wide-mode .site-main { max-width: 1100px; transition: max-width 0.2s; }

/* --- 채팅 말풍선 (에디터/글 양쪽에서 똑같이 보임) --- */
.chat-bubble {
    width: fit-content;
    max-width: 78%;
    margin: 10px 0;
    padding: 9px 14px;
    border-radius: 16px;
    line-height: 1.5;
}
.chat-bubble .chat-name {
    display: block;
    font-size: 12px;
    color: var(--sub);
    margin-bottom: 3px;
    font-weight: bold;
}
.chat-bubble .chat-text { display: block; }
/* 이름이 비면 공간 없이 접기 (보기 화면) */
.chat-bubble .chat-name:empty { display: none; }
/* 에디터에서만: 빈 이름/대사에 안내문구(입력하면 자동으로 사라짐) */
.note-editable .chat-bubble .chat-name:empty { display: block; }
.note-editable .chat-bubble .chat-name:empty::before,
.note-editable .chat-bubble .chat-text:empty::before {
    content: attr(data-ph);
    color: #b8b8bd;
    font-weight: normal;
}
/* 말풍선 색 팔레트(툴바 드롭다운) */
.bubblecolor-pop { display: flex; gap: 6px; padding: 4px; }
.bubblecolor-pick {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; cursor: pointer;
    border: 1px solid rgba(0,0,0,0.12);
}
.bubblecolor-pick:hover { transform: scale(1.12); }

/* --- 썸머노트 에디터 어둡게 (쓸 때 = 게시됐을 때 같아 보이게) --- */
.note-editor.note-frame { border: 1px solid var(--line) !important; border-radius: var(--radius); overflow: hidden; }
.note-editor .note-toolbar { background: var(--card-2) !important; border-bottom: 1px solid var(--line) !important; }
.note-editor .note-toolbar .note-btn { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; }
.note-editor .note-toolbar .note-btn:hover { background: var(--card-2) !important; color: var(--accent) !important; border-color: var(--accent) !important; }
.note-editor .note-editable { background: var(--card) !important; color: var(--text) !important; }
.note-editor .note-placeholder { color: #6f6f78 !important; }
.note-editor .note-statusbar { background: var(--card-2) !important; border-top: 1px solid var(--line) !important; }
.note-editor .note-codable { background: #121215 !important; color: #d8d3cd !important; }
.note-editor .dropdown-menu { background: var(--card) !important; border: 1px solid var(--line) !important; }
.note-editor .dropdown-menu a, .note-editor .dropdown-menu li > a { color: var(--text) !important; }
.note-editor .dropdown-menu a:hover, .note-editor .dropdown-menu li > a:hover { background: var(--card-2) !important; color: var(--accent) !important; }
.note-editor .note-modal .note-modal-content { background: var(--card); color: var(--text); }
.note-editor .note-modal .note-modal-header { border-bottom: 1px solid var(--line); }
.note-editor .note-modal .note-modal-footer { border-top: 1px solid var(--line); }

/* --- 💬 대화 일괄 변환 창 --- */
.cc-overlay {
    position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.45);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.cc-overlay.open { display: flex; }
.cc-box {
    background: var(--card); border-radius: 14px; width: min(680px, 96vw);
    max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cc-head {
    padding: 14px 18px; border-bottom: 1px solid var(--line);
    font-weight: bold; font-size: 15px; display: flex; justify-content: space-between; align-items: center;
}
.cc-x { background: none; border: none; font-size: 15px; color: var(--sub); cursor: pointer; padding: 2px 6px; }
.cc-x:hover { color: var(--point); }
.cc-body { padding: 14px 18px; overflow-y: auto; }
.cc-tip { color: var(--sub); font-size: 12.5px; margin: 0 0 10px; }
.cc-tip b { color: var(--point-dark); }
#ccInput {
    width: 100%; min-height: 190px; padding: 12px; font-size: 13.5px; line-height: 1.7;
    border: 1px solid var(--line); border-radius: 10px; resize: vertical;
    font-family: 'Pretendard', 'Malgun Gothic', sans-serif; box-sizing: border-box;
}
#ccInput:focus { outline: none; border-color: var(--point); }
.cc-speakers { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.cc-none { color: var(--sub); font-size: 12.5px; margin: 4px 0 0; }
.cc-spk {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--bg); border-radius: 9px; padding: 8px 11px;
}
.cc-spk-name { font-weight: bold; font-size: 13.5px; min-width: 74px; }
.cc-spk select {
    font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--line);
    border-radius: 7px; background: var(--card); color: var(--text);
}
.cc-showname { font-size: 12.5px; color: var(--sub); display: inline-flex; align-items: center; gap: 4px; }
.cc-showname input { width: auto; }
.cc-foot {
    padding: 12px 18px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.cc-count { font-size: 12.5px; color: var(--sub); }
.cc-go {
    background: var(--point); color: #fff; border: none; border-radius: 9px;
    padding: 9px 18px; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.cc-go:hover { background: var(--point-dark); }
@media (max-width: 640px) {
    .cc-spk-name { min-width: 100%; }
}

/* 왼쪽 화자 */
.chat-bubble.left {
    margin-right: auto;
    background: #2a2a30;
    border-bottom-left-radius: 5px;
}
/* 오른쪽 화자 */
.chat-bubble.right {
    margin-left: auto;
    background: #43323a;
    border-bottom-right-radius: 5px;
    text-align: right;
}

/* --- 카테고리 관리: 뷰 방식 선택 드롭다운 --- */
.cat-viewtype { display: inline; }
.cat-viewtype select { width: auto; font-size: 12px; padding: 3px 6px; border-radius: 6px; max-width: 190px; }

/* --- 🖼️ 갤러리형 모아보기 그리드 --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}
.gallery-item {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    text-decoration: none;
}
.gallery-thumb {
    position: relative;           /* 오버레이 기준 */
    aspect-ratio: 1 / 1;          /* 정사각형 썸네일 */
    background: var(--card-2);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb .no-img { font-size: 30px; opacity: 0.4; }
.gallery-cap { padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.gallery-cap-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-cap-date { color: var(--sub); font-size: 12px; margin-top: 2px; }

/* 갤러리형2: 사진만 + 마우스 오버 시 어두워지며 제목 */
.gallery-plain .gallery-item { background: transparent; }
.gallery-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 10px; text-align: center;
    background: rgba(0,0,0,0); opacity: 0;
    transition: background 0.2s, opacity 0.2s;
}
.gallery-item:hover .gallery-overlay { background: rgba(0,0,0,0.45); opacity: 1; }
.gallery-overlay span { color: #fff; font-size: 14px; font-weight: bold; line-height: 1.4; }

/* --- 🗞️ 썸네일형 (웹진 스타일) --- */
.thumb-list { display: flex; flex-direction: column; gap: 12px; }
.thumb-row {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--card); border-radius: var(--radius); padding: 16px;
    color: var(--text); transition: box-shadow 0.15s;
}
.thumb-row:hover { text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.thumb-row-text { flex: 1; min-width: 0; }
.thumb-row-title { margin: 0 0 6px; font-size: 17px; }
.thumb-row-excerpt {
    margin: 0 0 8px; color: var(--sub); font-size: 14px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thumb-row-meta { color: var(--sub); font-size: 12px; }
.thumb-row-img { width: 110px; height: 110px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.thumb-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- 💬 피드형 (짧은 감상 세로 피드) --- */
.feed-list { display: flex; flex-direction: column; gap: 14px; max-width: 600px; margin: 0 auto; }
.feed-card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; }
.feed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feed-date { color: var(--sub); font-size: 13px; }
.feed-admin a { font-size: 13px; margin-left: 8px; }
.feed-title { font-weight: bold; margin-bottom: 6px; }
.feed-content img { max-width: 100%; height: auto; border-radius: 8px; }
.feed-more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--sub); }

/* --- ▶️ 플레이리스트형 (유튜브 크게) --- */
.playlist-list { display: flex; flex-direction: column; gap: 20px; max-width: 720px; margin: 0 auto; }
.playlist-card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.playlist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.playlist-title { font-weight: bold; }

/* 유튜브 영상은 화면 폭에 꽉 차게 (피드/플레이리스트/글 본문 공통) */
.post-content iframe,
.feed-content iframe,
.playlist-body iframe {
    width: 100% !important;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border-radius: 8px;
}

/* --- 비밀글: 공개 설정 옵션 --- */
.secret-opt { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.secret-opt label { font-weight: normal; display: inline-flex; align-items: center; gap: 4px; }
.secret-opt input[type="radio"] { width: auto; }
.secret-opt .secret-hint { color: var(--sub); font-size: 12px; }
.secret-pw, .gb-secret-pw { width: auto; flex: 1; min-width: 160px; }

/* --- 우편함 안내 문구(집주인 인라인 수정) --- */
.gb-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.gb-intro .cat-help { margin: 0; }
.gb-intro-edit {
    font-size: 12px; color: var(--sub); background: var(--card);
    border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer;
}
.gb-intro-edit:hover { color: var(--point); border-color: var(--point); }
.gb-intro-form { display: flex; gap: 6px; flex: 1 1 100%; align-items: center; }
.gb-intro-form input[name="intro"] {
    flex: 1; min-width: 180px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.gb-intro-form button { white-space: nowrap; font-size: 13px; padding: 8px 12px; }
.gb-intro-form #gbIntroCancel { background: #9a9aa0; }

/* --- 우편함: 대영빌라 우편 고지서 편지 --- */
.gb-entry { margin-bottom: 22px; }
.gb-inv {
    position: relative; overflow: hidden;
    background: #f6f2e7; color: #211f19;
    border: 1px solid #d2cbb7; border-radius: 3px;
    font-family: 'Nanum Gothic Coding', monospace;
}
.gb-inv-wm {
    position: absolute; inset: 0; z-index: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    font-size: 60px; font-weight: 700; color: #c0261f; opacity: .055;
    letter-spacing: .1em; white-space: nowrap;
}
.gb-inv-wm span { transform: rotate(-8deg); }
.gb-inv-head {
    position: relative; z-index: 1;
    background: #c0261f; color: #fff; padding: 11px 16px;
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.gb-inv-title { font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.gb-inv-brand { font-size: 10px; opacity: .9; letter-spacing: .15em; white-space: nowrap; }
.gb-inv-meta {
    position: relative; z-index: 1; padding: 12px 16px 10px;
    border-bottom: 1px dashed #c9c1ab; font-size: 12px; color: #6f6857;
}
.gb-inv-metarow { display: flex; justify-content: space-between; gap: 12px; }
.gb-inv-metarow + .gb-inv-metarow { margin-top: 5px; }
.gb-inv-meta b { color: #211f19; }
.gb-inv-meta b.rcpt { color: #c0261f; }
.gb-inv-label {
    position: relative; z-index: 1; padding: 14px 16px 4px;
    font-size: 11px; color: #8a8271; letter-spacing: .1em;
}
.gb-inv-bodywrap {
    position: relative; z-index: 1; padding: 8px 16px 16px;
    display: flex; gap: 14px; align-items: flex-start;
}
.gb-inv-content {
    flex: 1; font-size: 13.5px; line-height: 1.95; color: #211f19; word-break: break-word;
}
.gb-inv-content.sealed { color: #8a8271; font-size: 13px; line-height: 1.8; }
.gb-inv-stamp {
    flex-shrink: 0; width: 70px; height: 70px;
    border: 2.5px solid #c0261f; color: #c0261f; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transform: rotate(-13deg); font-size: 12px; font-weight: 700; line-height: 1.25;
    text-align: center; box-shadow: inset 0 0 0 1px #c0261f;
}
.gb-inv-stamp span { font-size: 8.5px; font-weight: 400; }
.gb-inv-barcode {
    position: relative; z-index: 1; height: 34px; margin: 0 16px; opacity: .85;
    background: repeating-linear-gradient(90deg,#1c1a15 0 2px,transparent 2px 4px,#1c1a15 4px 5px,transparent 5px 9px,#1c1a15 9px 12px,transparent 12px 14px);
}
.gb-inv-barnum {
    position: relative; z-index: 1; text-align: center;
    font-size: 10px; color: #8a8271; letter-spacing: .3em; padding: 4px 0 12px;
}
.gb-inv-foot {
    position: relative; z-index: 1; padding: 9px 16px;
    border-top: 1px dashed #c9c1ab;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font-size: 11px; color: #8a8271;
}
.gb-inv-foot .gb-del { color: #c0261f; text-decoration: none; }
.gb-inv-foot .gb-del:hover { text-decoration: underline; }
.gb-inv .unlock-form { margin: 4px 16px 14px; max-width: 300px; justify-content: flex-start; }

/* 집주인 회신(관리자 답글) */
.gb-replybox { margin: 8px 0 0 24px; }
.gb-replybox > summary { cursor: pointer; font-size: 12px; color: var(--sub); list-style: none; padding: 4px 0; }
.gb-replybox > summary::-webkit-details-marker { display: none; }
.gb-replybox .reply-form { margin-top: 6px; }
.gb-reply {
    margin: 8px 0 0 24px; background: #fbf8ee;
    border: 1px solid #e2dbc7; border-left: 3px solid #c0261f; border-radius: 3px;
    font-family: 'Nanum Gothic Coding', monospace;
}
.gb-reply-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 8px 14px; border-bottom: 1px dashed #d9d2be; font-size: 11px;
}
.gb-reply-tag { color: #c0261f; font-weight: 700; letter-spacing: .03em; }
.gb-reply-date { color: #9a9182; }
.gb-reply-del { color: #c0261f; text-decoration: none; }
.gb-reply-body { padding: 10px 14px; font-size: 13px; line-height: 1.85; color: #211f19; word-break: break-word; }
@media (max-width: 640px) {
    .gb-inv-wm { font-size: 40px; }
    .gb-inv-title { font-size: 13px; }
    .gb-inv-brand { display: none; }
    .gb-inv-stamp { width: 58px; height: 58px; font-size: 11px; }
    .gb-reply, .gb-replybox { margin-left: 12px; }
}

/* --- 비밀글 잠금 화면 / 비번 입력 --- */
.secret-block { text-align: center; }
.unlock-form { display: flex; gap: 8px; justify-content: center; max-width: 340px; margin: 16px auto 0; }
.unlock-form input[type="password"] { flex: 1; }
.unlock-form button { white-space: nowrap; }
.unlock-inline { max-width: 300px; margin: 6px 0 0; }
.secret-body { color: var(--sub); }
.secret-badge { color: #c9302c; }
.feed-locked { color: var(--sub); padding: 8px 0; }

/* --- 관리자 답글 --- */
.reply-box { margin-top: 8px; }
.reply-box summary { font-size: 13px; color: var(--point); cursor: pointer; }
.reply-form { margin-top: 8px; }
.comment-reply {
    margin-left: 28px;
    border-left: 3px solid var(--point);
    background: var(--card-2);
}

/* --- 관리 대시보드: 댓글 뱃지 --- */
.cmt-badge { font-size: 13px; font-weight: bold; }
.cmt-zero { color: var(--sub); font-size: 13px; }

/* --- 카테고리 관리: 페이지당 글 수 입력 --- */
.cat-perpage { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sub); }
.cat-perpage input[type="number"] { width: 56px; padding: 3px 6px; font-size: 12px; }

/* --- 페이지네이션(쪽번호) --- */
.pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
    margin: 28px 0 4px;
}
.pagination a, .pagination .pg-cur {
    min-width: 34px; text-align: center;
    padding: 6px 10px; border-radius: 6px;
    font-size: 14px; background: var(--card); color: var(--text);
}
.pagination a:hover { background: var(--bg); text-decoration: none; }
.pagination .pg-cur { background: var(--point); color: #fff; font-weight: bold; }

/* --- 에디터 이모지 팝업 --- */
.emoji-dropdown-menu { padding: 8px !important; }
.emoji-pop {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
    width: 264px; max-height: 210px; overflow-y: auto;
}
.emoji-pick {
    cursor: pointer; font-size: 20px; text-align: center;
    padding: 4px 0; border-radius: 5px; line-height: 1;
}
.emoji-pick:hover { background: var(--card-2); }

/* --- 에디터 '전체글꼴' 드롭다운 --- */
.allfont-dropdown { padding: 4px 0 !important; min-width: 150px; }
.allfont-dropdown a { display: block; padding: 7px 14px; color: var(--text); white-space: nowrap; font-size: 15px; }
.allfont-dropdown a:hover { background: var(--card-2); text-decoration: none; }

/* --- 홈 인트로(전체화면 GIF) --- */
/* 화면 전체를 덮음 (현관문처럼). ☰ 버튼/사이드바는 이 위에 뜸 */
.home-hero {
    position: relative; z-index: 1;
    min-height: calc(100vh - 104px);
    display: flex; align-items: flex-start; justify-content: center;
    margin: -64px -20px 0;   /* site-main 여백을 벗어나 화면 끝까지 어둡게 */
    /* 지하실 어둠 + 네온 번짐 (이미지 없이 CSS만 → 로딩 0초) */
    background:
        radial-gradient(70% 45% at 50% 18%, rgba(224,68,122,0.13), transparent 70%),
        radial-gradient(50% 40% at 18% 82%, rgba(248,180,196,0.07), transparent 72%),
        linear-gradient(180deg, #1b1b1f 0%, #141417 55%, #101012 100%);
    padding: 24px; box-sizing: border-box;
    overflow-y: auto;
}
/* --- 404 --- */
.err404 { text-align: center; padding: 40px 20px 60px; }
.err-silhouette svg { filter: drop-shadow(0 0 26px rgba(248,180,196,0.16)); }
.err-cig { animation: cigGlow 3.4s ease-in-out infinite; }
@keyframes cigGlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.err-line {
    margin: 26px 0 8px; font-size: 21px;
    font-family: '북크크명조', 'Malgun Gothic', serif; color: var(--text);
}
.err-sub { margin: 0 0 28px; color: var(--sub); font-size: 13.5px; }
.err-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 🚬 담배 연기 — 아주 옅게 흐르기만 (과하지 않게) */
.smoke {
    position: absolute; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
}
.smoke i {
    position: absolute; bottom: -22%;
    width: 46vmin; height: 46vmin; border-radius: 50%;
    background: radial-gradient(circle, rgba(226,222,232,0.055), transparent 68%);
    filter: blur(26px);
    animation: smokeDrift 26s linear infinite;
}
.smoke i:nth-child(1) { left: 6%;  animation-duration: 26s; animation-delay: 0s; }
.smoke i:nth-child(2) { left: 42%; animation-duration: 34s; animation-delay: -11s; width: 60vmin; height: 60vmin; }
.smoke i:nth-child(3) { left: 74%; animation-duration: 30s; animation-delay: -20s; }
@keyframes smokeDrift {
    0%   { transform: translate(0, 0) scale(0.9); opacity: 0; }
    18%  { opacity: 1; }
    75%  { opacity: 0.7; }
    100% { transform: translate(9vw, -125%) scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .smoke { display: none; } }

/* ===== 🚪 대문 — 딸기우유 느와르 ===== */
.door {
    position: relative; z-index: 1;
    width: 100%; max-width: 640px;
    text-align: center; padding: 60px 20px 20px;
    animation: doorIn 1s ease both;
}
@keyframes doorIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.door-neon {
    margin: 0; font-size: clamp(1.9rem, 6vw, 2.7rem); font-weight: bold;
    letter-spacing: 0.26em; text-indent: 0.26em;   /* 자간 때문에 오른쪽이 밀리는 것 보정 */
    color: var(--accent); cursor: pointer; user-select: none;
    text-shadow: 0 0 5px var(--accent), 0 0 20px var(--accent), 0 0 42px var(--accent-deep);
    animation: neonFlicker 6s infinite;
}
.door-neon:hover { animation: doorGlitch 0.3s infinite; }
@keyframes doorGlitch {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, -2px); }
}
.door-sub {
    margin: 12px 0 42px; color: var(--sub);
    font-size: 0.8rem; letter-spacing: 0.2em;
}

/* ♪ 배경음 버튼 */
.door-bgm {
    width: 38px; height: 38px; padding: 0; margin: -26px 0 34px;
    border-radius: 50%; font-size: 15px; line-height: 1;
    background: transparent; color: var(--sub);
    border: 1px solid var(--line); transition: all 0.25s;
}
.door-bgm:hover { background: transparent; color: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(248,180,196,0.25); }
.door-bgm.on {
    color: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 16px rgba(248,180,196,0.35);
    animation: bgmPulse 1.6s ease-in-out infinite;
}
.door-bgm.waiting { color: var(--accent); border-color: rgba(248,180,196,0.4); }
@keyframes bgmPulse { 0%, 100% { box-shadow: 0 0 10px rgba(248,180,196,0.25); } 50% { box-shadow: 0 0 20px rgba(248,180,196,0.5); } }

.door-quote {
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    padding: 34px 16px; margin-bottom: 38px;
}
.door-typing {
    font-family: '북크크명조', 'Malgun Gothic', serif;
    font-size: clamp(1rem, 3.4vw, 1.25rem); color: var(--text); line-height: 1.8;
}
.door-typing::after {
    content: ''; display: inline-block;
    width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.15em;
    background: var(--accent); animation: caret 0.8s step-end infinite;
}
.door-typing.done::after { animation: none; opacity: 0; }
@keyframes caret { 50% { opacity: 0; } }
.door-credit { margin: 16px 0 0; color: #6f6f78; font-size: 0.78rem; }

/* 메뉴 카드 그리드 */
.door-nav {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px; margin-bottom: 60px;
}
.door-nav a, .door-nav button {
    display: block; width: 100%;
    padding: 18px 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: 0;
    color: var(--text); text-decoration: none; text-align: center;
    font-family: inherit; font-size: 0.95rem; font-weight: normal; letter-spacing: 0.1em;
    cursor: pointer; transition: all 0.25s;
}
.door-nav a:hover, .door-nav button:hover {
    background: var(--card);
    border-color: var(--accent); color: var(--accent);
    box-shadow: 0 0 14px rgba(248,180,196,0.25);
    transform: translateY(-2px);
    text-decoration: none;
}
.door-nav span { display: block; font-size: 1.4rem; margin-bottom: 6px; }

/* 대문 아래 푸터 */
.door-foot {
    margin-top: 46px; padding: 30px 20px 40px;
    border-top: 1px dashed var(--line);
    color: #55555c; font-size: 0.72rem; line-height: 1.8;
}
.door-foot-quote { color: var(--accent); font-style: italic; margin: 0 0 10px; font-size: 0.78rem; }

.door-counter {
    margin: 40px 0 0; color: var(--accent);
    font-size: 0.8rem; font-family: 'Nanum Gothic Coding', monospace;
}
.door-counter b {
    background: #000; padding: 3px 9px; border: 1px solid var(--accent);
    letter-spacing: 0.24em; font-weight: normal;
}
.door-milk { margin-top: 26px; font-size: 1.9rem; line-height: 1; }
.door-milk span { display: inline-block; animation: milkFloat 2.6s ease-in-out infinite; }
@keyframes milkFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) {
    .door-neon, .door-milk span, .door-typing::after { animation: none; }
}
@media (max-width: 640px) {
    .door-quote { padding: 26px 10px; margin-bottom: 30px; }
    .door-sub { margin-bottom: 32px; }
}

/* 🥚 간판 5번 클릭 이스터에그 */
.door-egg {
    position: fixed; inset: 0; z-index: 250;
    background: rgba(0,0,0,0.9);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.door-egg.open { display: flex; }
.egg-paper {
    background: #f0e6d2; color: #3a2f28;
    max-width: 420px; padding: 40px 32px;
    font-family: '북크크명조', 'Malgun Gothic', serif;
    font-size: 0.95rem; line-height: 2;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transform: rotate(-1.5deg);
    max-height: 84vh; overflow-y: auto;
}
.egg-paper h3 { margin: 0 0 18px; font-size: 0.8rem; color: #8a7563; font-weight: normal; }
.egg-close { margin-top: 24px; font-size: 0.75rem; color: #8a7563; cursor: pointer; text-decoration: underline; }

.home-hero-img {
    max-width: 100%;
    max-height: 100%;
    /* 배경과 매끄럽게 이어지도록 카드 테두리(둥근모서리·그림자) 제거 */
    animation: heroIn 1.2s ease both;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.home-hero.noimg::after { content: '여기에 assets/home.gif 를 넣어주세요'; color: var(--sub); font-size: 15px; }
/* 데스크탑에선 영상을 살짝 줄여서 세로가 안 잘리게 (모바일은 그대로 100%) */
@media (min-width: 641px) {
    .home-hero-img { max-width: 94%; max-height: 92%; }
}

/* --- 왼쪽 사이드바 + 토글 버튼 --- */
.menu-toggle {
    position: fixed; top: 14px; left: 14px; z-index: 60;
    width: 56px; height: 56px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; color: var(--text);
    font-size: 24px; cursor: pointer;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    transition: transform 0.14s;
}
/* 규상인 도장 이미지 — 칼선 없이 은은한 그림자만 */
.menu-toggle img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35)); }
.menu-toggle:hover { background: transparent !important; transform: scale(1.08) rotate(-3deg); }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: 288px; max-width: 84vw; color: #e2e4ee;
    /* 깊은 검정 밤하늘 + 은은한 성운 글로우 */
    background-color: #060608;
    background-image:
        radial-gradient(60% 22% at 60% 30%, rgba(224,68,122,0.12), transparent 72%),
        radial-gradient(45% 26% at 34% 68%, rgba(248,180,196,0.09), transparent 74%),
        linear-gradient(180deg, #0b0b0f, #070708 60%, #050506);
    background-repeat: no-repeat;
    border-right: 1px solid rgba(248,180,196,0.12);
    transform: translateX(-100%); transition: transform 0.28s ease;
    overflow-y: auto;
}
.sidebar.open { transform: translateX(0); box-shadow: 6px 0 44px rgba(0,0,0,0.65); }

/* 밤하늘 SVG (불규칙 별 · 별자리 · 별똥별) */
.sb-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* 작은 별 — 제각각 반짝 */
.sky-stars circle { animation: twk 3s ease-in-out infinite; }
.sky-stars circle:nth-child(4n)   { animation-duration: 2.4s; animation-delay: -0.5s; }
.sky-stars circle:nth-child(4n+1) { animation-duration: 3.6s; animation-delay: -1.3s; }
.sky-stars circle:nth-child(4n+2) { animation-duration: 2.8s; animation-delay: -2.1s; }
.sky-stars circle:nth-child(4n+3) { animation-duration: 3.3s; animation-delay: -0.9s; }
@keyframes twk { 0%,100% { opacity: 0.95; } 50% { opacity: 0.12; } }
/* 큰 별 — 크게 반짝 (글로우 + 맥동) */
.sky-big circle { transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 3px rgba(255,255,255,0.75)); animation: twkBig 2.1s ease-in-out infinite; }
.sky-big circle:nth-child(2n) { animation-duration: 2.8s; animation-delay: -1.1s; }
.sky-big circle:nth-child(3n) { animation-delay: -0.7s; }
@keyframes twkBig { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.5); } }
/* 별자리 별 (천칭·전갈) */
.sky-const-star circle { transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 3px currentColor); animation: twkBig 3.6s ease-in-out infinite; }
/* 별똥별 */
.sky-shoot { opacity: 0; animation: shoot 8s ease-in infinite; }
@keyframes shoot {
    0% { opacity: 0; transform: translate(-30px, -12px); }
    4% { opacity: 1; }
    13% { opacity: 0; transform: translate(225px, 118px); }
    100% { opacity: 0; transform: translate(225px, 118px); }
}
/* 스크롤바: 완전히 투명 (숨김) */
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sidebar-inner { position: relative; z-index: 1; padding: 22px 16px 32px; display: flex; flex-direction: column; gap: 2px; }
.sb-close {
    align-self: flex-end; width: 34px; height: 34px; padding: 0;
    background: transparent; color: #aeb4cf; border: none;
    font-size: 17px; cursor: pointer; border-radius: 8px;
}
.sb-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
/* === 대영빌라 밤하늘 사이드바 (은하수) === */
/* 간판 — 네온사인 (아주 가끔 깜빡) */
.sb-brand { margin: 4px 0 16px; }
.sb-brand a {
    color: var(--accent); font-size: 24px; font-weight: 600; letter-spacing: 2px;
    text-shadow: 0 0 5px var(--accent), 0 0 18px var(--accent), 0 0 34px var(--accent-deep);
    animation: neonFlicker 7s infinite;
}
.sb-brand a:hover { text-decoration: none; }
@keyframes neonFlicker {
    0%, 91%, 100% { opacity: 1; }
    92% { opacity: 0.35; }
    93% { opacity: 1; }
    95% { opacity: 0.6; }
    96% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .sb-brand a { animation: none; } }
.sb-brand-star { color: #fff0f4; font-size: 13px; margin-left: 2px; text-shadow: 0 0 8px var(--accent); }

.sb-section { font-size: 10px; color: #7f88b5; letter-spacing: 3px; margin: 20px 0 6px; text-transform: uppercase; }

/* 별 불릿 */
.sb-dot { width: 5px; height: 5px; border-radius: 50%; background: #6f646b; flex: 0 0 auto; box-shadow: 0 0 4px rgba(248,180,196,0.5); }

/* 로비 / 우편함 등 단일 메뉴 */
.sb-nav { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 8px; color: #cfd4ee; font-size: 15px; }
.sb-nav:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.sb-nav.active { color: #fff; }
.sb-nav.active .sb-dot { background: #f8b4c4; box-shadow: 0 0 8px rgba(248,180,196,0.95); }

/* 카테고리 */
.sb-catwrap { margin: 1px 0; }
.sb-cat { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 8px; }
.sb-cat:hover { background: rgba(255,255,255,0.06); }
.sb-cat-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; color: #cfd4ee; font-size: 15px; }
.sb-cat-link:hover { text-decoration: none; }
.sb-cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-room { font-size: 11px; color: #6f78a3; font-variant-numeric: tabular-nums; }
.sb-fold { width: 22px; height: 22px; padding: 0; background: transparent; border: none; color: #7f88b5; font-size: 12px; cursor: pointer; line-height: 1; transition: transform 0.22s; }
.sb-fold:hover { color: #cfd4ee; }
/* 활성: 규상 별처럼 빨갛게 빛남 */
.sb-cat.active .sb-cat-link { color: #fff; }
.sb-cat.active .sb-dot { background: #f8b4c4; box-shadow: 0 0 9px rgba(248,180,196,1); }
.sb-cat.active .sb-room { color: #e0554f; }

/* 하위 (접기/펴기) */
.sb-subs { display: none; margin: 2px 0 6px 22px; border-left: 1px solid rgba(248,180,196,0.18); }
.sb-catwrap.open .sb-subs { display: block; }
.sb-catwrap.open .sb-fold { transform: rotate(180deg); }
.sb-sub { display: block; padding: 6px 12px; font-size: 13px; color: #a89ea4; }
.sb-sub:hover { color: #f2ede7; background: rgba(255,255,255,0.05); text-decoration: none; }
.sb-sub.active { color: #e0554f; }

.sb-link { display: block; padding: 6px 12px; border-radius: 8px; color: #a89ea4; font-size: 13px; }
.sb-link:hover { background: rgba(255,255,255,0.05); color: #f2ede7; text-decoration: none; }

/* 사이드바 검색창 (밤하늘 톤) */
.sb-search { margin: 4px 0 12px; }
.sb-search input { width: 100%; padding: 9px 14px; font-size: 14px; color: #f2ede7; border: 1px solid rgba(248,180,196,0.22); border-radius: 20px; background: rgba(255,255,255,0.05); }
.sb-search input::placeholder { color: #7f88b5; }

/* 검색 페이지 폼 */
.search-page-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-page-form input { flex: 1; }
.search-page-form button { white-space: nowrap; }

/* 비밀댓글 */
.comment-form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cmt-secret { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--sub); cursor: pointer; }
.cmt-secret input { width: auto; }

.sidebar-overlay {
    position: fixed; inset: 0; z-index: 65;
    background: rgba(0,0,0,0.35);
    opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

/* --- 🧹 안 쓰는 이미지 정리 --- */
.clean-stat { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--sub); margin-bottom: 16px; }
.clean-stat b { color: var(--text); }
.clean-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.clean-item { position: relative; display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--card); }
.clean-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.clean-item input { position: absolute; top: 8px; left: 8px; width: auto; z-index: 2; }
.clean-size { display: block; text-align: center; font-size: 12px; color: var(--sub); padding: 5px 0; }

/* --- 🖼️ 포트폴리오 (사진 한 장, 팝! 하고 튀어나옴) --- */
.home-pop.folio-pop {
    width: auto; max-height: none; overflow: visible;
    background: transparent; box-shadow: none; border-radius: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.18s ease, transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.home-pop.folio-pop.open { transform: translate(-50%, -50%) scale(1); }
.folio-pop .folio-x { position: absolute; top: -16px; right: -16px; background: #fff; border: 1px solid var(--line); z-index: 3; }
.folio-img {
    display: block; width: auto; height: auto;
    max-width: 92vw; max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.42);
}

/* --- 📖 규상의 수첩 --- */
.home-pop.nb-pop { width: auto; background: transparent; box-shadow: none; overflow: visible; max-height: none; }
.nb-pop .nb-x { position: absolute; top: -16px; right: -16px; background: #fff; border: 1px solid var(--line); z-index: 5; }
/* 표지(cover.png) 비율 1024:1536 = 2:3 에 틀을 맞춰 표지·속지 크기 일치 */
.nb-book { position: relative; width: min(84vw, 360px); aspect-ratio: 1024 / 1536; perspective: 1600px; }

/* 속지 (아래에 깔림) */
.nb-inside {
    position: absolute; inset: 7% 8.5%;   /* png 투명 여백만큼 종이를 안쪽으로 (표지와 크기 맞춤) */
    background: #efe3c8 url('paper.jpg') center / cover;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    padding: 32px 26px 30px 34px; overflow: hidden;
    display: flex; flex-direction: column;
    opacity: 0; transition: opacity 0.4s ease 0.45s;   /* 표지 열릴 때 스르륵 나타남 */
}
.nb-book.opened .nb-inside { opacity: 1; }
/* 왼쪽 제본 스티치 */
.nb-stitch { position: absolute; left: 16px; top: 12px; bottom: 12px; width: 2px; border-left: 2px dashed rgba(120,90,50,0.4); }
.nb-inside::before { /* 줄노트 라인 */
    content: ''; position: absolute; left: 42px; right: 24px; top: 70px; bottom: 60px;
    background-image: repeating-linear-gradient(transparent 0 33px, rgba(90,70,45,0.22) 33px 34px);
    pointer-events: none;
}
.nb-page { display: none; flex: 1; overflow-y: auto; position: relative; z-index: 1; scrollbar-width: none; }
.nb-page::-webkit-scrollbar { display: none; }   /* 스크롤바 투명(숨김) */
.nb-page.on { display: block; }
.nb-title {
    font-family: 'KCC임권택체', serif; font-size: 20px; color: #3a2c18;
    margin-bottom: 12px; line-height: 32px;
}
.nb-body {
    font-family: 'KCC임권택체', serif; font-size: 15px; color: #4a3a22;
    line-height: 32px; white-space: pre-line; letter-spacing: 0.2px; word-break: keep-all;
}
/* 페이지 넘기기 — 우측 하단에 아주 심플하게 */
.nb-turner { position: absolute; right: 20px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 6px; }
.nb-turner button { background: none; border: none; color: #6b5638; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0.45; transition: opacity 0.15s; }
.nb-turner button:hover { opacity: 1; }
.nb-count { font-family: 'KCC임권택체', serif; font-size: 14px; color: #9a835f; }

/* 표지 (덮여있다가 열림) — 투명 png, 흰 테두리 없음 */
.nb-cover {
    position: absolute; inset: 0; z-index: 3; cursor: pointer;
    transform-origin: left center; transform: rotateY(0deg);
    transition: transform 0.9s cubic-bezier(0.4, 0.1, 0.2, 1), opacity 0.3s 0.6s;
    backface-visibility: hidden;
}
.nb-book.opened .nb-cover { transform: rotateY(-165deg); opacity: 0; pointer-events: none; }
.nb-cover-img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 14px 28px rgba(0,0,0,0.5)); }
/* Merry Christmas — 하나가 써준 손글씨 느낌 */
.nb-cover-tag {
    position: absolute; left: 0; right: 0; bottom: 27%; text-align: center;
    font-family: '온글잎 박다현체', sans-serif; font-size: 23px; color: #f4e6cb;
    transform: rotate(-4deg); text-shadow: 0 1px 6px rgba(0,0,0,0.65); pointer-events: none;
}
.nb-cover-hint { position: absolute; left: 0; right: 0; bottom: 5%; text-align: center; font-size: 12px; color: rgba(255,255,255,0.72); animation: nbHint 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes nbHint { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* 수첩 관리 페이지 */
.nb-edit-row { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.nb-edit-btns { display: flex; align-items: center; gap: 8px; }
.nb-edit-btns .nb-move { color: var(--point); padding: 0 4px; }
.nb-edit-btns button { padding: 6px 16px; }
.nb-edit-btns .nb-del { color: #d9534f; margin-left: auto; }

/* --- 📅 디데이 탁상달력 --- */
.home-pop.cal-pop { width: auto; background: transparent; box-shadow: none; overflow: visible; }
.cal-pop .cal-x { position: absolute; top: -14px; right: -14px; background: #fff; border: 1px solid var(--line); z-index: 3; }
.cal-card {
    position: relative; width: min(92vw, 430px);
    background: #fbfaf7; border-radius: 6px; padding: 26px 22px 16px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.22);
    font-family: 'Pretendard', sans-serif;
}
/* 스프링 링 */
.cal-rings { position: absolute; top: -9px; left: 0; right: 0; display: flex; justify-content: center; gap: 26px; }
.cal-rings i { width: 13px; height: 18px; border: 2.5px solid #b9b4ab; border-radius: 50%; background: transparent; }
.cal-body { display: flex; align-items: center; gap: 18px; }
.cal-left { flex: 0 0 auto; }
.cal-dday { font-size: 52px; font-weight: 800; letter-spacing: -2px; color: #16161a; line-height: 1; }
.cal-label { font-size: 13px; font-weight: 700; letter-spacing: 0.5px; color: #16161a; margin-top: 6px; }
.cal-right { flex: 1; min-width: 0; }
.cal-year { text-align: right; font-size: 12px; font-weight: 700; color: #16161a; margin-bottom: 6px; }
.cal-grid { width: 100%; border-collapse: collapse; }
.cal-grid th { font-size: 11px; font-weight: 800; color: #16161a; padding: 2px 0; text-align: center; }
.cal-grid td { font-size: 12px; color: #4a463f; text-align: center; padding: 4px 0; position: relative; }
/* 오늘 — 빨간 색연필 손그림 동그라미 (두 겹으로 삐뚤빼뚤) */
.cal-grid td.today { color: #111; font-weight: 700; }
.cal-grid td.today::before, .cal-grid td.today::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 26px; height: 22px; pointer-events: none;
    border: 2px solid #e0332f;
}
.cal-grid td.today::before { transform: translate(-50%,-50%) rotate(-7deg); border-radius: 50% 52% 47% 53% / 55% 45% 58% 42%; opacity: 0.9; }
.cal-grid td.today::after  { transform: translate(-50%,-50%) rotate(6deg);  border-radius: 47% 53% 52% 48% / 45% 57% 43% 55%; opacity: 0.55; }
.cal-foot { margin-top: 12px; text-align: right; font-size: 11px; color: #9a948a; }

/* --- 🎞️ 필름 라이트박스 --- */
.film-lb {
    position: fixed; inset: 0; z-index: 200; background: rgba(8,8,8,0.94);
    display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 20px;
}
.film-lb.open { display: flex; }
.film-x { position: absolute; top: 18px; right: 20px; background: rgba(255,255,255,0.14); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.film-x:hover { background: rgba(255,255,255,0.26); }
.film-strip { width: 100%; max-width: min(1280px, 96vw); background: #0d0d0d; box-shadow: 0 12px 46px rgba(0,0,0,0.65); }
.film-holes { height: 24px; background: repeating-linear-gradient(to right, transparent 0 11px, #efeae1 11px 29px, transparent 29px 40px); }
.film-row { display: flex; align-items: center; gap: 12px; padding: 14px 12px; }
.film-side { flex: 0 0 17%; opacity: 0.38; cursor: pointer; transition: opacity 0.15s; }
.film-side:hover { opacity: 0.7; }
.film-side img { width: 100%; height: 64vh; object-fit: cover; display: block; }
.film-main { flex: 1; position: relative; min-width: 0; }
.film-main img { width: 100%; height: 64vh; object-fit: contain; display: block; background: #000; }
.film-num { position: absolute; top: 4px; color: #e8e2d6; font-size: 10px; letter-spacing: 1px; opacity: 0.75; }
.film-num-l { left: 6px; } .film-num-r { right: 6px; }
.film-bar { display: flex; align-items: center; gap: 14px; color: #eee; font-size: 14px; flex-wrap: wrap; justify-content: center; }
.film-bar button { background: rgba(255,255,255,0.14); color: #fff; border: none; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.film-bar button:hover { background: rgba(255,255,255,0.26); }
.film-bar a { color: #ffd0dc; }

/* --- 💖 좋아요 (반짝이는 하트) --- */
.like-box { text-align: center; margin: 30px 0 6px; }
.like-btn {
    background: none; border: none; cursor: pointer; padding: 6px;
    font-size: 46px; line-height: 1;
    filter: drop-shadow(0 0 5px rgba(255,120,170,0.45));
    animation: heartGlow 2.2s ease-in-out infinite;
    transition: transform 0.15s;
}
.like-btn:hover { transform: scale(1.14); }
.like-btn.liked { filter: drop-shadow(0 0 12px rgba(255,60,140,0.9)); animation: heartGlowOn 1.6s ease-in-out infinite; }
.like-btn.pop { animation: heartPop 0.4s ease; }
@keyframes heartGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255,130,175,0.35)); }
    50%      { filter: drop-shadow(0 0 11px rgba(255,90,155,0.7)); }
}
@keyframes heartGlowOn {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255,80,150,0.7)); transform: scale(1); }
    50%      { filter: drop-shadow(0 0 16px rgba(255,40,130,1)); transform: scale(1.06); }
}
@keyframes heartPop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.like-count { font-size: 14px; color: var(--sub); margin-top: 2px; }

/* 하트 터지는 파티클 */
.heart-particle {
    position: fixed; z-index: 9999; pointer-events: none; font-size: 20px;
    transform: translate(-50%, -50%);
    animation: heartFloat 0.95s ease-out forwards;
}
@keyframes heartFloat {
    to { transform: translate(calc(-50% + var(--dx, 0px)), -90px) rotate(var(--dr, 0deg)); opacity: 0; }
}

/* --- 하단 --- */
.site-footer { text-align: center; color: var(--sub); font-size: 13px; padding: 30px; }

/* --- 🏠 홈 스티커 아이콘 (좌3/우3, 삐뚤빼뚤) + 팝업 --- */
.sticker {
    position: fixed; z-index: 40; width: 104px; height: 104px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 0; color: var(--text);
    font-size: 54px; line-height: 1; cursor: pointer;
    transform: rotate(var(--rot, 0deg));
    animation: wiggle 3.2s ease-in-out infinite;
}
/* 픽토그램만 딱 + 스티커 칼선(흰 테두리) + 살짝 그림자 */
.sticker img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    filter:
        drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff)
        drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
        drop-shadow(1.6px 1.6px 0 #fff) drop-shadow(-1.6px -1.6px 0 #fff)
        drop-shadow(1.6px -1.6px 0 #fff) drop-shadow(-1.6px 1.6px 0 #fff)
        drop-shadow(0 3px 4px rgba(0,0,0,0.28));
}
.sticker:hover { animation-play-state: paused; transform: rotate(var(--rot, 0deg)) scale(1.16) !important; background: transparent !important; z-index: 41; }

@keyframes wiggle {
    0%, 100% { transform: rotate(var(--rot, 0deg)); }
    25% { transform: rotate(calc(var(--rot, 0deg) + 4deg)) translateY(-3px); }
    50% { transform: rotate(calc(var(--rot, 0deg) - 2deg)) translateY(1px); }
    75% { transform: rotate(calc(var(--rot, 0deg) + 2deg)) translateY(-2px); }
}

.st1 { --rot: -9deg; left: 6%;   top: 11%; animation-delay: 0s; }
.st2 { --rot: 6deg;  left: 11%;  top: 41%; animation-delay: -0.7s; }
.st3 { --rot: -5deg; left: 4%;   top: 71%; animation-delay: -1.4s; }
.st4 { --rot: 8deg;  right: 7%;  top: 13%; animation-delay: -0.4s; }
.st5 { --rot: -7deg; right: 12%; top: 43%; animation-delay: -1.1s; }
.st6 { --rot: 5deg;  right: 5%;  top: 73%; animation-delay: -1.8s; }

.pop-overlay {
    position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.4);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.pop-overlay.show { opacity: 1; pointer-events: auto; }
.home-pop {
    position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -46%);
    width: min(360px, 90vw); max-height: 78vh; overflow-y: auto;
    background: var(--card); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.home-pop.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.pop-head {
    position: sticky; top: 0; background: var(--card);
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: bold;
}
.pop-close {
    width: 30px; height: 30px; padding: 0; background: transparent; border: none;
    color: var(--sub); font-size: 16px; cursor: pointer; border-radius: 8px;
}
.pop-close:hover { background: var(--bg); }
.pop-body { padding: 18px; }
.pop-empty { color: var(--sub); text-align: center; line-height: 1.8; }
.pop-text { margin: 0; }
.pop-btn { display: block; text-align: center; margin-top: 14px; padding: 10px; background: var(--point); color: #fff; border-radius: 8px; }
.pop-btn:hover { background: var(--point-dark); text-decoration: none; }
.dday-body { text-align: center; padding: 10px 0; }
.dday-num { font-size: 34px; font-weight: bold; color: var(--point); }
.dday-sub { color: var(--sub); margin-top: 4px; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-grid a { aspect-ratio: 1; overflow: hidden; border-radius: 8px; display: block; }
.album-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.memo-note { background: #fff7d6; border-radius: 8px; padding: 16px; line-height: 1.8; font-family: '온글잎 박다현체', inherit; font-size: 17px; }
.gb-mini { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.gb-mini span { color: var(--sub); }
.track { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.track:hover { background: var(--bg); text-decoration: none; }

/* 📸 앨범 — 아이폰 카메라 스타일 (사진 비율에 맞춰 자동 크기) */
.home-pop.cam-pop { width: auto; background: transparent; box-shadow: none; overflow: visible; }
.cam-pop .cam-x { position: absolute; top: -14px; right: -14px; background: #fff; border: 1px solid var(--line); z-index: 3; }
.cam-frame { background: #0b0b0d; border-radius: 22px; padding: 8px 8px 14px; width: min(92vw, 400px); box-shadow: 0 16px 50px rgba(0,0,0,0.45);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Apple SD Gothic Neo", 'Pretendard', "Segoe UI", Roboto, sans-serif; }
.cam-top { position: relative; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff; }
.cam-dot { color: #f5c518; font-size: 10px; }
.cam-island { position: absolute; left: 50%; top: 5px; transform: translateX(-50%); width: 74px; height: 20px; background: #000; border-radius: 12px; }
.cam-ctrl { font-size: 15px; }
.cam-viewwrap { position: relative; display: block; line-height: 0; border-radius: 6px; overflow: hidden; background: #000; }
.cam-photo { display: block; width: 100%; height: auto; }
.cam-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.4); }
.cam-grid i:nth-child(1) { left: 33.33%; } .cam-grid i:nth-child(2) { left: 66.66%; }
.cam-grid span { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.4); }
.cam-grid span:nth-child(3) { top: 33.33%; } .cam-grid span:nth-child(4) { top: 66.66%; }
.cam-focus { position: absolute; left: 50%; top: 50%; width: 66px; height: 66px; transform: translate(-50%,-50%); border: 1px solid rgba(245,197,24,0.85); border-radius: 4px; pointer-events: none; }
.cam-caption { color: #fff; font-size: 13px; text-align: center; padding: 9px 6px 0; }
.cam-modes { display: flex; gap: 14px; justify-content: center; color: #999; font-size: 12px; padding: 12px 6px 8px; overflow-x: auto; white-space: nowrap; }
.cam-modes b { color: #f5c518; }
.cam-bottom { display: flex; align-items: center; justify-content: space-between; padding: 4px 26px 2px; }
.cam-thumb { width: 34px; height: 34px; border-radius: 7px; background-size: cover; background-position: center; border: 1px solid #444; }
.cam-shutter { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; }
.cam-shutter span { width: 44px; height: 44px; border-radius: 50%; background: #fff; }
.cam-flip { color: #fff; font-size: 22px; }

/* 📝 메모 — 포스트잇 (규상/하나 글씨체, 삐뚤) */
.home-pop.memo-pop { width: min(340px, 92vw); background: transparent; box-shadow: none; overflow: visible; }
.memo-pop .memo-x { position: absolute; top: -12px; right: -8px; background: #fff; border: 1px solid var(--line); z-index: 3; }
.memo-stack { display: flex; flex-direction: column; align-items: center; padding: 22px 0; }
.postit { position: relative; width: 84%; padding: 20px 20px 22px; margin-bottom: 8px; box-shadow: 0 5px 14px rgba(0,0,0,0.16); font-size: 19px; line-height: 1.55; color: #3a352f; }
.postit-who { display: block; font-size: 12px; opacity: 0.55; margin-bottom: 6px; }
.postit-hana { background: #fbd9e7; font-family: '온글잎 박다현체', sans-serif; }
.postit-gyu  { background: #cfe0f2; font-family: 'KCC임권택체', sans-serif; }
.postit::before { content: ''; position: absolute; top: -10px; left: 50%; width: 60px; height: 20px; background: rgba(255,255,255,0.55); transform: translateX(-50%) rotate(-3deg); }
.postit:nth-child(1) { transform: rotate(-3deg); }
.postit:nth-child(2) { transform: rotate(2.5deg); margin-top: -2px; }
.postit:nth-child(3) { transform: rotate(-1.5deg); }
.postit:nth-child(4) { transform: rotate(3deg); }
.postit:nth-child(n+5) { transform: rotate(-2deg); }

/* 🎵 플레이리스트 — 유튜브뮤직 스타일 */
.home-pop.ytm-pop { width: auto; background: transparent; box-shadow: none; overflow: visible; max-height: none; }
.ytm-pop .ytm-x { position: absolute; top: -14px; right: -14px; background: #fff; border: 1px solid var(--line); z-index: 3; }
.ytm-phone {
    width: min(92vw, 360px); max-height: 86vh; overflow: hidden;
    background: #0f0f0f; color: #fff; border-radius: 26px;
    padding: 8px 0 0; display: flex; flex-direction: column;
    box-shadow: 0 18px 55px rgba(0,0,0,0.55);
    font-family: 'Pretendard', -apple-system, sans-serif;
    -webkit-user-select: none; user-select: none;   /* 클릭 시 파란 선택영역 방지 */
}
.ytm-status { display: flex; justify-content: space-between; align-items: center; padding: 4px 18px 6px; font-size: 13px; }
.ytm-sysicons { display: flex; align-items: center; gap: 5px; color: #fff; }
.ytm-topbar { display: flex; justify-content: space-between; padding: 4px 16px 8px; color: #fff; }
.ytm-art { position: relative; width: 62%; aspect-ratio: 1; margin: 4px auto 14px; border-radius: 6px; overflow: hidden; cursor: pointer; background: #222; }
.ytm-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytm-art #ytPlayer { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.ytm-eq { position: absolute; left: 8px; top: 8px; display: none; gap: 2px; align-items: flex-end; height: 14px; }
.ytm-eq i { width: 3px; background: #ff0033; border-radius: 1px; animation: eqBar 0.8s ease-in-out infinite; }
.ytm-eq i:nth-child(1) { height: 60%; animation-delay: 0s; }
.ytm-eq i:nth-child(2) { height: 100%; animation-delay: -0.3s; }
.ytm-eq i:nth-child(3) { height: 45%; animation-delay: -0.6s; }
@keyframes eqBar { 0%,100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.ytm-plname { text-align: center; font-size: 19px; font-weight: 600; }
.ytm-avatars { display: flex; justify-content: center; margin-top: 7px; }
.ytm-avatars .av { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; display: flex; align-items: center; justify-content: center; border: 2px solid #0f0f0f; }
.ytm-avatars .av-g { background: #2f5d80; color: #cfe6f7; }
.ytm-avatars .av-h { background: #7d3350; color: #f7cfe0; margin-left: -7px; }
.ytm-meta { text-align: center; font-size: 12px; color: #9c9c9c; margin-top: 6px; }
.ytm-desc { text-align: center; font-size: 12px; color: #7e7e7e; margin-top: 3px; }
.ytm-actions { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0 10px; }
.ytm-abtn { width: 40px; height: 40px; border-radius: 50%; background: #262626; border: none; color: #e8e8e8; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ytm-abtn:hover { background: #333; }
.ytm-bigplay { width: 56px; height: 56px; border-radius: 50%; background: #fff; border: none; color: #0f0f0f; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ytm-bigplay .ic-play { margin-left: 3px; }
.ic-pause { display: none; }
body.ytm-playing .ic-play { display: none; }
body.ytm-playing .ic-pause { display: block; }
.ytm-list { flex: 1; overflow-y: auto; padding: 2px 12px 6px; }
.ytm-list::-webkit-scrollbar { width: 5px; }
.ytm-list::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 3px; }
.ytm-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.ytm-row:hover { background: #1c1c1c; }
.ytm-row.on .ytm-rtitle { color: #ff5577; }
.ytm-rthumb { width: 42px; height: 42px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; }
.ytm-rtext { flex: 1; min-width: 0; }
.ytm-rtitle { font-size: 13px; color: #f1f1f1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytm-rartist { font-size: 11px; color: #8f8f8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytm-who { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.ytm-who.who-g { background: #1f3a52; color: #a9cbe0; }
.ytm-who.who-h { background: #4b1f33; color: #f0b9cf; }
.ytm-rmore { color: #7a7a7a; flex: 0 0 auto; }
.ytm-nav { display: flex; justify-content: space-around; padding: 9px 0 12px; background: #0f0f0f; border-top: 1px solid #232323; font-size: 10px; color: #8a8a8a; }
.ytm-nav .on { color: #fff; }
.ytm-empty { padding: 40px 20px; text-align: center; color: #9c9c9c; font-size: 14px; }

/* 팝업 닫아도 계속 재생되는 미니 플레이어 */
.ytm-float {
    position: fixed; z-index: 95; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(120%);
    display: flex; align-items: center; gap: 10px;
    background: #1e1e1e; color: #fff; border-radius: 30px; padding: 7px 10px 7px 7px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4); opacity: 0; pointer-events: none;
    transition: transform 0.28s ease, opacity 0.28s ease; max-width: 92vw;
}
.ytm-float.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.ytm-float img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.ytm-floattitle { font-size: 13px; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ytm-floatbtn { background: none; border: none; color: #fff; cursor: pointer; padding: 0 4px; display: flex; align-items: center; }
.ytm-floatstop { color: #999; font-size: 15px; }

/* ============================================================
   📱 모바일 (아이폰 13 mini = 폭 375px 기준, 640px 이하 적용)
   ============================================================ */
@media (max-width: 640px) {
    /* 본문 영역 여백 줄이기 */
    .site-main { margin: 62px auto 30px; padding: 0 14px; }
    .page-title { font-size: 18px; }

    /* 글 읽기 — 상단만 둥근 박스, 본문은 박스 밖으로 빼서 가로폭 확보 */
    .post { background: transparent; border: none; padding: 0; box-shadow: none; }
    .post-head-box {
        background: var(--card); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 18px 16px; margin-bottom: 16px;
    }
    .post .post-title { font-size: 21px; }
    .post-content { border-top: none; padding-top: 2px; }
    .post-actions { padding: 0 2px; }

    /* 관리 대시보드: 버튼/표 압축 */
    .admin-toolbar { flex-wrap: wrap; }
    .admin-tools { padding: 10px; gap: 6px; }
    .admin-tools .btn { flex: 1 1 auto; text-align: center; }
    .admin-postbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .admin-filter select { width: 100%; }
    .admin-table th, .admin-table td { padding: 8px 6px; font-size: 12px; }
    .admin-table .ord-col { width: 34px; }
    .table-actions a { margin-right: 6px; }

    /* 카테고리 관리: 컨트롤이 넘치지 않게 줄바꿈 */
    .cat-row { flex-wrap: wrap; row-gap: 8px; }
    .cat-rename { flex: 1 1 100%; }
    .cat-rename input[type="text"] { max-width: none; }
    .cat-viewtype select { max-width: 150px; }
    .cat-child { padding-left: 20px; }
    .cat-add input[type="text"] { min-width: 0; }

    /* 갤러리: 한 줄에 2칸 */
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

    /* 썸네일형: 이미지 조금 작게 */
    .thumb-row { padding: 14px; gap: 12px; }
    .thumb-row-img { width: 88px; height: 88px; }
    .thumb-row-title { font-size: 16px; }

    /* 피드/플레이리스트 여백 */
    .feed-card { padding: 16px; }
    .playlist-card { padding: 14px; }
    .comment { padding: 12px 14px; }

    /* 사이드바가 화면을 거의 덮게 */
    .sidebar { width: 84vw; }

    /* 홈 인트로: 여백 줄여 gif 더 크게 */
    .home-hero { padding: 12px; }

    /* 이모지 팝업이 화면 밖으로 안 나가게 */
    .emoji-pop { width: min(264px, 74vw); grid-template-columns: repeat(7, 1fr); }

    /* 탁상달력 · 필름 라이트박스 모바일 */
    .cal-card { padding: 24px 16px 14px; }
    .cal-body { gap: 12px; }
    .cal-dday { font-size: 40px; }
    .film-side { flex-basis: 13%; }
    .film-side img { height: 42vh; }
    .film-main img { height: 42vh; }
    .film-row { gap: 6px; padding: 10px 6px; }

    /* 홈 스티커: 위 3개 / 아래 3개 (크게) */
    .sticker { width: 74px; height: 74px; font-size: 40px; }
    .st1 { --rot: -8deg; left: 6%;  right: auto; top: 10%; bottom: auto; }
    .st2 { --rot: 5deg;  left: 39%; right: auto; top: 7%;  bottom: auto; }
    .st3 { --rot: -5deg; left: 72%; right: auto; top: 11%; bottom: auto; }
    .st4 { --rot: 7deg;  left: 6%;  right: auto; top: auto; bottom: 11%; }
    .st5 { --rot: -6deg; left: 39%; right: auto; top: auto; bottom: 8%;  }
    .st6 { --rot: 5deg;  left: 72%; right: auto; top: auto; bottom: 12%; }
}
