/* ---------- 전체 레이아웃: 헤더 / 좌우 사이드 / 본문 / 푸터 ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; min-height: 560px; }

.shell-header {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.shell-header .brand { padding: 0; width: 182px; flex-shrink: 0; }
.shell-header-title { font-size: 15px; font-weight: 700; color: var(--text-2); }

/* 검색창 — 좌측 사이드바(220px)가 끝나는 지점(로고 182px + gap 14px + 헤더 좌측 패딩 24px)에서 시작 */
.header-search { display: flex; align-items: center; gap: 6px; }
.header-search select {
  height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12.5px; flex-shrink: 0;
}
.header-search input[type="text"] {
  width: 220px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13px;
}
.header-search input[type="text"]:focus { outline: none; border-color: var(--accent); }
.header-search .btn { height: 32px; width: 32px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* ---------- 검색 결과 ---------- */
.search-result-list { display: flex; flex-direction: column; gap: 2px; }
.search-result-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 8px; cursor: pointer;
}
.search-result-item:hover { background: var(--surface-2); }
.search-result-item .t { font-size: 14px; font-weight: 500; }
.search-result-item .c { font-size: 12.5px; color: var(--text-3); }
.mypage-trigger { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }

/* ---------- 프로필 이미지 배지: 작성자 이름 앞, 헤더 등 어디서나 공통 사용 ---------- */
.avatar-badge {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700;
  vertical-align: -4px; margin-right: 5px;
}
.avatar-badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-badge-sm { width: 18px; height: 18px; font-size: 10px; }
.avatar-badge-md { width: 26px; height: 26px; font-size: 12px; }
.avatar-badge-lg { width: 72px; height: 72px; font-size: 26px; }
.note-author-cell { display: inline-flex; align-items: center; }

.shell-body { display: flex; flex-grow: 1; min-height: 0; }

.shell-sidebar {
  width: 220px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 14px; gap: 14px; overflow-y: auto;
}

.shell-main { flex-grow: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.shell-footer {
  height: 34px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter);
  border-top: 1px solid var(--border); background: var(--surface); color: var(--text-3); font-size: 11.5px;
}

.nav-link i.ph { font-size: 18px; flex-shrink: 0; }

.board-layout { display: flex; flex-grow: 1; min-width: 0; min-height: 0; }

/* ---------- 중앙: 게시글 목록/에디터 ---------- */
.board-main { flex-grow: 1; min-width: 0; overflow-y: auto; padding: 22px var(--gutter); display: flex; flex-direction: column; gap: 18px; }

.board-header { display: flex; align-items: center; gap: 10px; }
.board-title { font-size: 20px; font-weight: 700; }
.board-total { font-size: var(--font-size-xs); color: var(--text-3); }

.note-table { width: 100%; border-collapse: collapse; }
.note-table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 700; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.note-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: var(--font-size-sm); }
.note-table tr:hover td { background: var(--surface-2); cursor: pointer; }
.note-table td:first-child, .note-table th:first-child { cursor: default; }
.note-title-cell { display: flex; align-items: center; gap: 8px; }
.note-file-badge { font-size: 11px; color: var(--text-3); }
.note-comment-badge { font-size: 11px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.note-comment-badge i { font-size: 12px; }

.bulk-action-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--accent-strong);
}

.note-pager { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 0; }
.note-pager .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.note-pager .btn:disabled { opacity: .4; cursor: default; }

/* ---------- 에디터 ---------- */
.note-editor { display: flex; flex-direction: column; gap: 12px; }
.note-editor input[type="text"] {
  font-size: 18px; font-weight: 700; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.note-editor-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- 리치텍스트 에디터 (RichEditor) ---------- */
.rich-editor-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.re-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.re-group { display: flex; gap: 2px; }
.re-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 2px; }
.re-btn {
  min-width: 28px; height: 28px; padding: 0 6px; border: none; border-radius: 6px; background: transparent;
  color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.re-btn:hover { background: var(--surface-3); color: var(--text); }
.re-btn.active { background: var(--accent-soft); color: var(--accent-strong); }
.re-color-btn { position: relative; overflow: hidden; }
.re-color-btn input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.re-body {
  min-height: 320px; padding: 16px; font-size: var(--font-size-sm); line-height: 1.7; color: var(--text);
  outline: none;
}
.re-body:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.re-body h1 { font-size: 22px; font-weight: 700; margin: 0.6em 0 0.3em; }
.re-body h2 { font-size: 19px; font-weight: 700; margin: 0.6em 0 0.3em; }
.re-body h3 { font-size: 16px; font-weight: 700; margin: 0.6em 0 0.3em; }
.re-body p { margin: 0 0 0.6em; }
.re-body blockquote { margin: 0.6em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--text-2); }
.re-body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.re-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.re-body pre code { background: none; padding: 0; }
.re-body img { max-width: 100%; border-radius: 8px; display: block; margin: 6px auto; }
.re-body ul, .re-body ol { padding-left: 1.4em; margin: 0.4em 0; }
.re-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.re-body a { color: var(--accent-strong); text-decoration: underline; }

.re-source {
  min-height: 320px; width: 100%; padding: 16px; border: none; background: var(--surface); color: var(--text);
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: 13px; line-height: 1.6; resize: vertical; box-sizing: border-box;
}

.rich-content h1 { font-size: 22px; font-weight: 700; margin: 0.6em 0 0.3em; }
.rich-content h2 { font-size: 19px; font-weight: 700; margin: 0.6em 0 0.3em; }
.rich-content h3 { font-size: 16px; font-weight: 700; margin: 0.6em 0 0.3em; }
.rich-content p { margin: 0 0 0.7em; }
.rich-content blockquote { margin: 0.6em 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--text-2); }
.rich-content pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.rich-content code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.rich-content pre code { background: none; padding: 0; }
.rich-content img { max-width: 100%; border-radius: 8px; display: block; margin: 6px auto; }
.rich-content ul, .rich-content ol { padding-left: 1.4em; margin: 0.4em 0; }
.rich-content hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.rich-content a { color: var(--accent-strong); text-decoration: underline; }

.re-upload-note { padding: 6px 8px; font-size: 12px; color: var(--text-3); }

.attach-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.attach-box-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; }

.note-view { display: flex; flex-direction: column; gap: 14px; }
.note-view-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-view-title-row .btn { flex-shrink: 0; margin-top: 2px; }
.note-view-title { font-size: 22px; font-weight: 700; }
.note-view-meta { display: flex; gap: 12px; color: var(--text-3); font-size: var(--font-size-xs); }
.note-view-content { white-space: pre-wrap; line-height: 1.7; font-size: var(--font-size-sm); }
.note-attach-list { display: flex; flex-direction: column; gap: 8px; }
.note-attach-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.note-attach-item:hover { border-color: var(--accent); }

/* ---------- 댓글/대댓글 (모든 스킨 내용보기 공통) ---------- */
.comments-section { border-top: 1px solid var(--border); padding-top: 16px; }
.comments-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.comments-list { display: flex; flex-direction: column; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item.comment-reply {
  margin: 10px 0 0 20px; padding: 10px 12px; border: none; border-left: 2px solid var(--accent-soft);
  background: var(--surface-2); border-radius: 0 8px 8px 0;
}
.comment-head { display: flex; align-items: center; gap: 6px; }
.comment-author { font-size: 13.5px; font-weight: 600; }
.comment-date { font-size: 11.5px; color: var(--text-3); }
.comment-actions { margin-left: auto; display: flex; gap: 8px; }
.comment-link-btn { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--text-3); padding: 0; }
.comment-link-btn:hover { color: var(--accent); }
.comment-link-btn.danger:hover { color: var(--danger); }
.comment-body { margin-top: 5px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.comment-reply-toggle { margin-top: 6px; }
.comment-edit-box, .comment-reply-box, .comment-new-box { margin-top: 8px; }
.comment-edit-box textarea, .comment-reply-box textarea, .comment-new-box textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: inherit; resize: vertical;
}
.comment-box-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.comment-new-box { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }

/* ---------- 우측: 카테고리 패널 ---------- */
.cat-panel { width: 280px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--surface); padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.cat-panel-title { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: 0.2px; }

.cat-tree { display: flex; flex-direction: column; gap: 2px; }
.cat-tree-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: var(--font-size-sm); color: var(--text-2); cursor: pointer;
}
.cat-tree-item:hover { background: var(--surface-2); }
.cat-tree-item.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.cat-tree-item .skin-badge { margin-left: auto; font-size: 10.5px; color: var(--text-3); }
.cat-tree-item.child { padding-left: 26px; }

.cat-mgr-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.cat-mgr-box-title { font-size: 12px; font-weight: 700; color: var(--text-3); }
.cat-mgr-box input, .cat-mgr-box select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--font-size-sm);
}
.cat-row2 { display: flex; gap: 6px; }
.cat-row2 select { flex-grow: 1; }

.cat-list-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; }
.cat-list-item .name { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list-item .skin { font-size: 10.5px; color: var(--text-3); }
.cat-li-btn { background: none; border: none; color: var(--text-3); padding: 3px; cursor: pointer; }
.cat-li-btn:hover { color: var(--accent); }
.cat-li-btn.danger:hover { color: var(--danger); }

/* ---------- 우측 패널 위젯: 최근글 / 최근이미지 / 태그 ---------- */
.panel-widget { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.panel-widget-title { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: 0.2px; }

.widget-note-list { display: flex; flex-direction: column; }
.widget-note-item {
  display: flex; align-items: center; gap: 6px; padding: 7px 2px; font-size: 12.5px; color: var(--text-2);
  border-bottom: 1px solid var(--border); cursor: pointer; overflow: hidden;
}
.widget-note-item:last-child { border-bottom: none; }
.widget-note-item:hover { color: var(--accent-strong); }
.widget-note-item .t { flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-note-item .c { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }

.widget-image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.widget-image-grid .tile { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.widget-image-grid .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.widget-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.widget-tag-cloud .tag-chip {
  font-size: 11.5px; padding: 4px 9px; border-radius: 20px; background: var(--surface-2);
  color: var(--text-2); border: 1px solid var(--border); cursor: pointer; transition: background .12s, color .12s;
}
.widget-tag-cloud .tag-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 대시보드(중앙) ---------- */
.dash-profile-card {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px 20px;
}
.dash-profile-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.dash-profile-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dash-role-badge {
  font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 20px;
}
.dash-profile-meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.dash-profile-quota { flex: 1; min-width: 220px; }
.dash-quota-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.dash-profile-quota .quota-bar { height: 8px; }

.dash-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dash-stat-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.dash-stat-tile i { font-size: 26px; color: var(--accent); flex-shrink: 0; }
.dash-stat-tile b { display: block; font-size: 19px; font-weight: 700; }
.dash-stat-tile span { font-size: 12px; color: var(--text-3); }

@media (max-width: 700px) {
  .dash-stat-row { grid-template-columns: 1fr; }
}

.dash-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.dash-card-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.dash-note-row { padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.dash-note-row:last-child { border-bottom: none; }
.dash-note-row:hover { color: var(--accent-strong); }
.dash-note-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-note-row .c { color: var(--text-3); font-size: 11.5px; flex-shrink: 0; }
.dash-image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-image-grid .tile { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.dash-image-grid .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
  .dash-summary-grid { grid-template-columns: 1fr; }
}

/* ---------- 목록 보기 전환 (목록형/웹진형) ---------- */
.view-toggle { display: flex; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.view-toggle button { border-radius: 6px; }
.view-toggle button.active { background: var(--accent); color: #fff; }

.webzine-grid { display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.webzine-card { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px; cursor: pointer; transition: border-color .12s; }
.webzine-card:hover { border-color: var(--accent); }
.webzine-thumb { width: 108px; height: 78px; flex-shrink: 0; border-radius: 8px; background: var(--surface-2); overflow: hidden; position: relative; }
.webzine-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.webzine-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.webzine-title { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webzine-excerpt {
  font-size: 12.5px; color: var(--text-2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.webzine-meta { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; margin-top: 2px; }

/* ---------- 게시글 옵션(중요/공용/MD/태그/유튜브) ---------- */
.note-options-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.opt-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.note-options-box select, .note-options-box input[type="text"], .note-options-box input[type="url"] {
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px;
}

/* ---------- 유튜브/영상/오디오 임베드 ---------- */
.yt-embed { max-width: 1920px; margin: 0 auto; }
.yt-embed iframe, .yt-embed video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: none; display: block; }
.yt-embed.yt-shorts { max-width: 400px; }
.yt-embed.yt-shorts iframe { aspect-ratio: 9 / 16; }
.audio-embed {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 4px;
}
.audio-embed audio { flex-grow: 1; height: 34px; }

/* ---------- 이북형: 목록(책 표지 그리드) ---------- */
.ebook-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; padding: 20px; }
.ebook-card { cursor: pointer; display: flex; flex-direction: column; transition: transform .15s; }
.ebook-card:hover { transform: translateY(-4px); }
.ebook-cover {
  aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; background: var(--surface-2);
  box-shadow: -3px 3px 10px rgba(0,0,0,.3), 2px 2px 4px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.ebook-cover img, .ebook-cover canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.ebook-cover::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: linear-gradient(to right, rgba(0,0,0,.25), transparent); z-index: 1;
}
.ebook-info { padding: 8px 4px 0; }
.ebook-title {
  font-size: 14px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ebook-meta { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.pdf-no-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 40px; color: var(--pdf); }

@media (max-width: 1279px) { .ebook-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .ebook-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; } }

/* ---------- 갤러리형: 카드 목록(가로로 나열, 카드는 450px 고정폭) ---------- */
.gallery-list { display: flex; flex-flow: row wrap; gap: 20px; padding: 16px; }
.gallery-card {
  width: 450px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.gallery-card-thumb { width: 100%; aspect-ratio: 16 / 9; background: var(--surface-2); position: relative; }
.gallery-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card-thumb .pdf-no-thumb { width: 100%; height: 100%; font-size: 40px; }

.yt-badge {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.75); color: #fff;
  font-size: 11px; padding: 2px 6px; border-radius: 4px; line-height: 1.4;
}
.gallery-card-info { padding: 12px 16px; background: var(--surface-2); }
.gallery-card-title { font-size: 15px; font-weight: 600; }
.gallery-card-meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

/* ---------- 갤러리형: 내용보기 첨부 이미지 그리드 ---------- */
.note-gallery { columns: 3; column-gap: 12px; margin-top: 4px; }
.note-gallery-item { display: block; break-inside: avoid; margin-bottom: 12px; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.note-gallery-item img { display: block; width: 100%; height: auto; transition: transform .2s; }
.note-gallery-item:hover img { transform: scale(1.02); }
@media (max-width: 1279px) { .note-gallery { columns: 2; } }
@media (max-width: 767px) { .note-gallery { columns: 1; } }

/* ---------- 이북형: 내용보기 (xNote와 동일한 표지+오버레이 카드) ---------- */
.pdf-section { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 24px; }
.pdf-item { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-thumb-wrap {
  position: relative; cursor: pointer; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--surface-2); width: 240px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); transition: box-shadow .2s, transform .2s;
}
.pdf-thumb-wrap:hover { box-shadow: 0 8px 28px rgba(0,0,0,.22); transform: translateY(-2px); }
.pdf-thumb-wrap img, .pdf-thumb-wrap canvas { display: block; width: 100%; height: auto; }
.pdf-thumb-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(0,0,0,.5); color: #fff; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; z-index: 2;
}
.pdf-thumb-wrap:hover .pdf-thumb-overlay { opacity: 1; }
.pdf-meta { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pdf-name { font-size: 15px; font-weight: 500; word-break: break-all; max-width: 280px; }
.pdf-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }

/* ---------- 오디오형: 게시글 목록 카드 ---------- */
.audio-note-list { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.audio-note-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.audio-note-card:hover { background: var(--surface-2); }
.audio-note-card .t { flex: 1; font-size: 14px; font-weight: 500; }
.audio-note-card .c { font-size: 12.5px; color: var(--text-3); }

/* ---------- 일정관리(캘린더) — xNote CalendarView와 동일 ---------- */
.cal-wrap { display: flex; flex-direction: column; min-height: 600px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.cal-title { font-size: 16.5px; font-weight: 700; min-width: 140px; text-align: center; }
.cal-nav { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; border: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.cal-nav:hover { background: var(--surface-2); }
.cal-today-btn { padding: 5px 11px; border-radius: 5px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; background: none; color: var(--text); transition: background .12s; }
.cal-today-btn:hover { background: var(--surface-2); }
.cal-view-btns { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.cal-view-btns button { padding: 5px 11px; font-size: 13px; border: none; cursor: pointer; background: none; color: var(--text); transition: background .12s; }
.cal-view-btns button.active { background: var(--accent); color: #fff; }
.cal-view-btns button:not(.active):hover { background: var(--surface-2); }
.cal-dow-row { display: flex; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.cal-dow { flex: 1; text-align: center; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cal-dow.sun { color: var(--danger); }
.cal-dow.sat { color: #4f9cf9; }
.cal-body { flex: 1; }
.cal-week-row { display: flex; position: relative; border-bottom: 1px solid var(--border); }
.cal-day-cell { flex: 1; min-width: 0; border-right: 1px solid var(--border); padding: 3px 5px; cursor: pointer; transition: background .1s; }
.cal-day-cell:last-child { border-right: none; }
.cal-day-cell:hover { background: var(--surface-2); }
.cal-day-cell.other { opacity: .4; }
.cal-day-cell.today .cal-day-num { background: var(--accent); color: #fff !important; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-day-cell.sun .cal-day-num { color: var(--danger); }
.cal-day-cell.sat .cal-day-num { color: #4f9cf9; }
.cal-day-cell.hol .cal-day-num { color: var(--danger); }
.cal-day-top { display: flex; align-items: center; gap: 4px; min-height: 22px; }
.cal-day-num { font-size: 13.5px; font-weight: 500; flex-shrink: 0; }
.cal-lunar { font-size: 11px; color: var(--text-3); }
.cal-hol-name { font-size: 10.5px; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px; }
.cal-week-events { position: absolute; inset: 0; pointer-events: none; }
.cal-ev-bar { position: absolute; height: 19px; line-height: 19px; color: #fff; font-size: 12px; cursor: pointer; pointer-events: all; overflow: hidden; white-space: nowrap; transition: opacity .12s; }
.cal-ev-bar:hover { opacity: .85; }
.cal-ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cal-day-ev-item { padding: 10px 13px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 6px 6px 0; margin-bottom: 8px; cursor: pointer; transition: background .12s; }
.cal-day-ev-item:hover { background: var(--surface-3); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.modal { background: var(--surface); border-radius: 12px; padding: 20px; width: 100%; }
.modal h2 { font-size: 17px; margin-bottom: 14px; }
.modal .form-group { margin-bottom: 12px; }
.modal .form-label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.modal input[type="text"], .modal input[type="date"], .modal input[type="password"], .modal input[type="email"],
.modal input[type="tel"], .modal select, .modal textarea {
  width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13.5px;
}
.modal input:disabled { opacity: .6; cursor: not-allowed; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { opacity: .9; }

/* ---------- 마이페이지 모달 ---------- */
.mypage-modal { max-width: 460px; max-height: 86vh; overflow-y: auto; }
.mypage-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.mypage-avatar-row .avatar-badge-lg { font-size: 26px; }
.mypage-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.mypage-divider { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.mypage-pw-row + .mypage-pw-row { margin-top: 6px; }

@media (max-width: 1023px) {
  .cat-panel { display: none; }
}
