/* =========================================================
   레이아웃 — 미니멀한 티스토리 스킨 느낌 (흰 바탕, 좁은 본문, 넓은 여백)
   색상 변수는 entry.css 에 있습니다.
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "MaruBuri", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container { max-width: 1000px; margin: 0 auto; padding: 48px 20px 80px; } /* 모든 페이지 본문 폭 1000px (세로 메뉴 레이아웃) */
.container.wide { padding-top: 28px; }

/* ---------- 왼쪽 세로 메뉴 (.side) ----------
   1200px 이상: 헤더 아래 왼쪽 기둥(폭 150px)에 소개 → 카테고리 → 아이콘 → 검색창
   1200px 미만: 맨 위 한 줄(☰ · 검색창 · 아이콘) + ☰ 를 누르면 그 줄 바로 아래에서 열리는 왼쪽 서랍 */
.side { position: relative; z-index: 50; }

/* 프로필 버튼: 포인트 색 둥근 사각형 */
.profile-link, .profile-link:hover, .profile-link.on {
  display: block; padding: 9px 0; border-radius: 8px; background: var(--accent); color: var(--bg);
  font-size: 14px; font-weight: 700; line-height: 1.6; text-align: center; text-decoration: none;
}
.profile-link:hover { filter: brightness(1.08); }
.profile-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 프로필 버튼 위 프로필 사진: 프로필 페이지와 같은 동그란 사진 + '사진 테두리' 색 (다크 모드는 프로필 페이지처럼 어둡게 섞음) */
.side-photo { display: block; width: 100px; margin: 0 auto 14px; border-radius: 50%; }
.side-photo img { display: block; width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--pf-soft, #efe8fb); box-sizing: border-box; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side-photo img { border-color: color-mix(in srgb, var(--pf-soft, #efe8fb) 22%, #16171a); }
}
:root[data-theme="dark"] .side-photo img { border-color: color-mix(in srgb, var(--pf-soft, #efe8fb) 22%, #16171a); }

/* 카테고리: 오른쪽 정렬 (프로필 버튼 오른쪽 끝에서 14px 안쪽), 이름 옆에 글 수 */
.gnb { display: flex; flex-direction: column; align-items: flex-end; padding-right: 14px; }
.gnb a { padding: 8px 0; color: var(--sub); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.gnb a:hover { color: var(--text-strong); }
.gnb a.on { color: var(--accent); font-weight: 700; }
/* 글 수: 오른쪽 끝을 맞춰 한 자리·두 자리 수가 섞여도 줄이 가지런하게 */
.gnb-n { display: inline-block; min-width: 18px; margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.gnb a.on .gnb-n { color: var(--accent); }

/* 아이콘 줄: 검색 · (관리자) 글쓰기 · 다크 모드 · 설정(톱니바퀴)
   버튼 크기 고정 → 아이콘이 3개든 4개든 줄어들지 않아 톱니바퀴 위치가 같음 */
.tools { display: flex; align-items: center; gap: 4px; }
.tools > .icon-btn { flex: none; width: 36px; height: 36px; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--sub);
  cursor: pointer;
}
.icon-btn:hover { background: var(--soft); color: var(--text-strong); }
/* ☰·어두운 막은 1200px 미만에서만 (위 .icon-btn 의 display 보다 뒤에 둬야 숨겨짐) */
.side-burger, .side-dim { display: none; }

/* 검색창: 돋보기를 누르면 PC 는 아이콘 줄 밑(프로필 버튼과 같은 폭), 휴대폰은 맨 위 줄 안(☰ 와 아이콘 사이)에 나옴.
   배경 없이 아이콘과 같은 색 테두리만. 눌러서 입력할 때도 모양이 바뀌지 않음  */
.search-bar input[type=search] {
  display: block;
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--sub);
  border-radius: 10px;
  background: none;
  font-size: 16px;
  outline: none;
}
.search-bar input[type=search]:focus { outline: none; }

@media (min-width: 1200px) {
  /* 헤더 이미지(가로 전체) 아래 .page: [빈칸 | 메뉴 190px | 본문 1000px | 빈칸] — 메뉴 위치는 모든 페이지에서 같음 */
  .page {
    display: grid; grid-template-columns: 1fr 190px minmax(0, 1000px) 1fr;
    grid-template-areas: ". side main ." ". side footer .";
    grid-template-rows: 1fr auto;
  }
  main { grid-area: main; min-width: 0; }
  .site-footer { grid-area: footer; }
  .container { margin: 0; }   /* 본문은 메뉴 쪽(왼쪽)에 붙임 */
  .side {
    grid-area: side; align-self: start; position: sticky; top: 0;
    max-height: 100vh; overflow-y: auto; scrollbar-width: none;
    display: flex; flex-direction: column;
    width: 150px; margin: 0 25px 0 auto; padding: 64px 0 30px;   /* 메뉴와 본문 글 사이 45px */
  }
  .side::-webkit-scrollbar { display: none; }
  .side-drawer { display: contents; }   /* PC 에서는 서랍 상자를 풀어 순서(order)대로 한 기둥에 */
  .side-photo { order: 1; }
  .profile-link { order: 2; }
  .gnb { order: 3; margin-top: 18px; }
  .tools { order: 4; justify-content: flex-end; margin-top: 14px; margin-right: -7px; } /* 아이콘 그림 끝을 프로필 버튼 끝에 맞춤 */
  .search-bar { order: 5; margin-top: 6px; }
  .search-bar input[type=search] { padding-top: 7.6px; padding-bottom: 7.6px; font-size: 14px; }   /* 글자가 작아진 만큼 여백을 늘려 높이(39.6px)는 그대로 */
}

@media (max-width: 1199px) {
  /* 맨 위 한 줄: ☰ · 검색창(열었을 때) · 아이콘. 스크롤해도 위에 붙어 있음 */
  .side {
    position: sticky; top: 0;
    display: flex; align-items: center; gap: 6px; height: 56px;
    padding: 0 max(12px, calc(50% - 488px));
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .side-burger { display: grid; order: 0; }
  .search-bar { order: 1; flex: 1; min-width: 0; }
  .search-bar input[type=search] { padding-top: 6px; padding-bottom: 6px; }
  .tools { order: 2; margin-left: auto; }
  /* 서랍: 맨 위 줄 바로 아래(--drawer-top, site.js 가 잼)에서 시작, 오른쪽 위·아래 모서리 둥글게 */
  .side-drawer {
    position: fixed; z-index: 2; top: var(--drawer-top, 56px); left: 0; bottom: 0;
    width: 72vw; max-width: 260px; padding: 26px 26px 20px; overflow-y: auto;
    background: var(--bg); border-radius: 0 16px 16px 0;
    transform: translateX(-102%); visibility: hidden; transition: transform .2s ease, visibility .2s;
  }
  /* 그림자는 열렸을 때만, 오른쪽(본문 쪽)으로만 → 닫혔을 때 화면 왼쪽 끝·열렸을 때 맨 위 줄에 회색이 번지지 않게 */
  .side-open .side-drawer { transform: none; visibility: visible; box-shadow: 8px 0 30px rgba(0, 0, 0, .12); clip-path: inset(0 -40px 0 0); }
  .side-dim { display: block; position: fixed; z-index: 1; inset: var(--drawer-top, 56px) 0 0 0; background: rgba(0, 0, 0, .35); }
  .gnb { margin-top: 16px; }
  .gnb a { padding: 10px 0; font-size: 16px; }
}

/* ---------- 목록 ---------- */
.list-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 18px; border-bottom: 2px solid var(--text-strong); }
.list-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-strong); }
.list-head .count { color: var(--accent); font-weight: 700; font-size: 15px; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { border-bottom: 1px solid var(--line); }
.item-link {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 30px 0;
  text-decoration: none;
  color: inherit;
}
.item-link .txt { flex: 1; min-width: 0; }
.item-link .cat { font-size: 13px; font-weight: 600; color: var(--accent); }
.item-link .title {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}
.item-link:hover .title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
/* 검색 결과: 제목·미리보기 속 검색어 강조 (포인트 색을 연하게) */
.item-link mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.item-link .ex {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.item-link .meta { display: flex; align-items: center; font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.item-link .thumb {
  flex: none;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}
.lock { margin-right: 4px; font-size: .85em; }
.empty { padding: 80px 0; text-align: center; color: var(--sub); }
.empty a { color: var(--accent); }

.paging { display: flex; justify-content: center; gap: 4px; margin-top: 48px; flex-wrap: wrap; }
.paging a {
  min-width: 36px; height: 36px;
  padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 18px;
  text-decoration: none;
  color: var(--sub);
  font-size: 14px;
}
.paging a:hover { background: var(--soft); }
.paging a.on { background: var(--text-strong); color: var(--bg); font-weight: 700; }

/* ---------- 글 보기 ---------- */
.post-head { padding-bottom: 28px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.post-head .cat { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.post-title {
  margin: 10px 0 14px;
  font-size: 32px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-strong);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.post-meta { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--sub); flex-wrap: wrap; }
/* 날짜 | (글자 수) | 조회수 — 칸 사이 회색 세로선 (글 보기 제목 아래, 글 목록) */
.date-hit { display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
/* 날짜는 늘 같은 길이(2026. 12. 05.)라 칸 너비를 따로 고정하지 않아도 조회수 위치가 글마다 같음 */
.date-hit > * + *, .item-link .meta > * + * { border-left: 1px solid var(--line); margin-left: .5em; padding-left: .5em; line-height: 1.1; }
.admin-links { display: inline-flex; gap: 10px; align-items: center; }
.admin-links form { display: inline; margin: 0; }
.admin-links a, .link-btn { color: var(--sub); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.admin-links a:hover, .link-btn:hover { color: var(--text-strong); text-decoration: underline; }

.game-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 20px;
  margin: 0 0 40px;
  padding: 20px 22px;
  border-radius: 10px;
  background: var(--soft);
}
.game-card div { min-width: 0; }
.game-card dt { font-size: 12px; color: var(--sub); margin-bottom: 2px; }
.game-card dd { margin: 0; font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.game-card dd a { text-decoration: none; border-bottom: 1px solid currentColor; }
.game-card .stars { color: #f4a62a; letter-spacing: 1px; }

.post-nav { margin-top: 72px; border-top: 1px solid var(--line); }
.post-nav a {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-nav a span { display: inline-block; width: 72px; color: var(--sub); font-size: 13px; font-weight: 400; }
.post-nav a:hover { color: var(--text-strong); }
.back { margin-top: 28px; font-size: 14px; }
.back a { color: var(--sub); text-decoration: none; }

/* ---------- 라이트박스 ---------- */
.lightbox {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(0, 0, 0, .92);
  color: #fff;
}
.lightbox.open { display: block; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 48px 56px; overflow: auto; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain; cursor: zoom-in; }
.lightbox.zoomed .lb-stage { display: block; padding: 0; }
.lightbox.zoomed .lb-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox button {
  position: absolute;
  z-index: 2;
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  width: 46px; height: 46px;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.zoomed .lb-prev, .lightbox.zoomed .lb-next { display: none; }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 13px; opacity: .8; }

/* ---------- 폼 공통 ---------- */
.form-page h1 { font-size: 24px; margin: 0 0 24px; color: var(--text-strong); }
/* 설치·로그인: 본문 칸은 다른 페이지와 같은 너비(1000px), 그 안에서 입력 칸 묶음을 가운데에 */
.auth-page { max-width: 400px; margin: 0 auto; text-align: center; }
.auth-page .checklist { justify-items: center; }
.stack { display: grid; gap: 16px; }
.stack label { display: grid; gap: 6px; font-size: 14px; color: var(--sub); }
input[type=text], input[type=password], input[type=search], input[type=datetime-local], input[type=number], select, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  padding: 10px 12px;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--text-strong); outline-offset: -1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--text-strong); border-color: var(--text-strong); color: var(--bg); }
.error { background: #fdecea; color: #b3261e; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.notice { background: var(--soft); padding: 14px 16px; border-radius: 6px; line-height: 1.7; }
.checklist { padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; margin: 0 0 24px; }
.checklist li::before { content: "• "; color: var(--sub); }
.checklist li.ok::before { content: "✓ "; color: #1a8f4c; }
.checklist li.ng::before { content: "✕ "; color: #b3261e; }

/* ---------- 글쓰기 ---------- */
.write-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.write-top select { flex: none; }
.title-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 10px 4px !important;
  font-size: 26px !important;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: transparent !important;
}
.title-input:focus { outline: none; border-bottom-color: var(--text-strong) !important; }

.game-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 1fr;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.game-fields legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.game-fields label { display: grid; gap: 4px; font-size: 12px; color: var(--sub); min-width: 0; }
.game-fields input, .game-fields select { width: 100%; padding: 8px 10px; font-size: 14px; }

.editor-tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.editor-tabs button {
  border: 0;
  background: none;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.editor-tabs button.on { color: var(--text-strong); font-weight: 700; border-bottom-color: var(--text-strong); }
.tab-help { margin-left: auto; font-size: 12px; color: var(--sub); }
.editor-wrap { margin-top: 10px; }
.editor-wrap .tox-tinymce { border-radius: 8px; border-color: var(--line); }
.html-source {
  width: 100%;
  min-height: 70vh;
  font-family: Consolas, "D2Coding", monospace;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre-wrap;
  resize: vertical;
}

/* 글쓰기 아래 줄(이미지 처리·작성일·비공개·저장). 예전엔 화면 아래에 붙어 따라오게(sticky) 했는데,
   편집기 아래쪽(마지막 줄·글자 수 줄)을 덮고 휴대폰에선 화면의 1/4을 가려서 편집기 바로 밑 제자리에 둠 */
.write-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.write-bar .opts { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--sub); }
.write-bar .opts label { display: inline-flex; gap: 6px; align-items: center; }
.write-bar .opts select, .write-bar .opts input { padding: 6px 8px; font-size: 13px; }
.write-bar .actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.upload-status { font-size: 13px; color: var(--accent); }
.page-write .site-footer { display: none; }

/* ---------- 푸터: 카피라이트만, 본문 너비 기준 가운데 (구분선 없음) ---------- */
.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: flex;
  justify-content: center;
  font-size: 13px;
  color: var(--sub);
  /* 카피라이트만 프리텐다드 (본문 기본은 마루부리) */
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* ---------- 모바일 ---------- */
@media (max-width: 760px) {
  .container { padding: 32px 16px 60px; }
  .container.wide { padding-top: 16px; }

  .item-link { gap: 16px; padding: 22px 0; }
  .item-link .title { font-size: 17px; margin: 4px 0 6px; }
  .item-link .ex { font-size: 14px; margin-bottom: 6px; }
  .item-link .thumb { width: 92px; height: 92px; }

  .post-head { margin-bottom: 28px; padding-bottom: 20px; }
  .post-title { font-size: 25px; }
  .game-card { padding: 16px; margin-bottom: 28px; }
  .lb-stage { padding: 48px 0; }

  .write-top { flex-direction: column; align-items: stretch; }
  .title-input { font-size: 21px !important; }
  .game-fields { grid-template-columns: 1fr 1fr; }
  .tab-help { display: none; }
  .write-bar .actions { width: 100%; }
  .write-bar .actions .btn { flex: 1; }
}

.hint { font-size: 13px; color: var(--sub); margin: 0; line-height: 1.6; }

/* ---------- 설정 ---------- */
.set-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); } /* 칸 너비는 화면 폭까지만 (좁은 휴대폰에서 넓은 줄이 상자를 밀어내지 않게) */
.set-group h2 { font-size: 17px; margin: 0; color: var(--text-strong); }
.stack label small { font-size: 12px; color: var(--sub); font-weight: 400; }
.stack label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
/* 관리자 페이지 설명문: 양쪽 정렬. 한글은 글자(음절) 사이에서 줄을 바꾸게 둬서(keep-all 안 씀)
   줄 끝을 맞추느라 띄어쓰기가 크게 벌어지지 않게 함. 긴 영문·주소는 아무 데서나 끊어 넘치지 않게.
   text-justify: inter-character = 남는 폭을 띄어쓰기에만 몰지 않고 글자 사이에 고르게 나눔 (크롬·엣지·파이어폭스) */
.settings-page .hint { text-align: justify; text-justify: inter-character; word-break: normal; overflow-wrap: anywhere; }
/* 설정 → 관리 → 보안 → 비밀번호 변경: 입력 칸이 본문 폭(1000px)으로 너무 길어지지 않게 */
.pw-form { max-width: 420px; }
/* 설정 → 디자인 → 모서리 장식: 라이트·다크 그림을 각 모드 배경 위에 나란히 보여 줌 */
.corner-preview { display: flex; gap: 12px; flex-wrap: wrap; }
.corner-box { display: grid; gap: 6px; justify-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.corner-box.dark { background: #16181a; }
.corner-box small { font-size: 12px; color: #888; }
.settings-page .actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.settings-page > .tab-panel { margin-top: 28px; }
/* 설정 탭 (페이지 이동 없이 내용만 바꿔 보여줌) */
.set-site { display: grid; gap: 14px; }
.set-tabs { display: flex; gap: 2px; margin-top: 14px; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; }
.set-tabs::-webkit-scrollbar { display: none; }
.set-tabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; padding: 10px 16px; font: inherit; font-size: 15px; color: var(--sub);
  cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.set-tabs button:hover { color: var(--text-strong); }
.set-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.set-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tabs-on .tab-panel > .set-group:first-child { border-top: 0; }
.tabs-on > .tab-panel { margin-top: 0; }
.tabs-on .nojs-only { display: none; }
@media (max-width: 600px) { .set-tabs button { padding: 10px 12px; font-size: 14.5px; } }
/* 소분류 탭: 대분류 바로 아래에 붙은 작은 글자 탭 (테두리·배경 없이, 고른 것만 포인트 색 + 짧은 밑줄) */
.set-subtabs { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: -12px 0 0; } /* 폼 줄 간격(16px)을 상쇄해 대분류 바로 밑에 붙임 */
.set-subtabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 6px 10px 5px; font: inherit; font-size: 13px; color: var(--sub); cursor: pointer; white-space: nowrap; }
.set-subtabs button:hover { color: var(--text-strong); }
.set-subtabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.set-subtabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tabs-on .sub-panel > .set-group:first-child { border-top: 0; }
/* 관리 탭은 저장 폼 밖이라 폼 줄 간격이 없음 → 다른 탭과 같은 위치(대분류 밑 4px)가 되게 */
#panel-manage > .set-subtabs { margin-top: 4px; }
/* 로그아웃 버튼 세 개: 가장 긴 버튼에 맞춰 같은 너비 (휴대폰처럼 좁으면 세로로 쌓되 너비는 그대로 같게) */
.logout-all { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; justify-self: start; }
.logout-all .btn { justify-content: center; text-align: center; }
/* 휴대폰은 세로로 쌓고 화면 폭에 꽉 차게 (누르기 쉽게) */
@media (max-width: 760px) { .logout-all { grid-auto-flow: row; justify-self: stretch; } }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cat-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.cat-row .cat-name { min-width: 0; width: 100%; }
.cat-row .check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); white-space: nowrap; }
.cat-count { font-size: 12px; color: var(--sub); white-space: nowrap; }
.cat-move { display: flex; flex-direction: column; }
.icon-btn.sm { width: 24px; height: 18px; border-radius: 4px; font-size: 10px; }
.icon-btn:disabled { opacity: .25; cursor: default; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: #b3261e; }
.btn:disabled { opacity: .4; cursor: default; }

@media (max-width: 760px) {
  .cat-row { grid-template-columns: auto 1fr auto; grid-template-areas: "move name del" "move game count"; row-gap: 6px; }
  .cat-move { grid-area: move; }
  .cat-row .cat-name { grid-area: name; }
  .cat-row .check { grid-area: game; }
  .cat-count { grid-area: count; text-align: right; }
  .cat-row [data-act=del] { grid-area: del; }
}

/* ---------- 댓글 ---------- */
.comments { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
/* 댓글로 이동했을 때 위에 붙은 헤더에 가려지지 않게 */
.comments, .cmt { scroll-margin-top: 90px; }
.cmt-title { font-size: 17px; margin: 0 0 18px; color: var(--text-strong); }
.cmt-title .count { color: var(--accent); margin-left: 4px; }
.cmt-list { list-style: none; margin: 0 0 24px; padding: 0; }
.cmt { padding: 16px 0; border-bottom: 1px solid var(--line); }
.cmt-reply { padding-left: 28px; position: relative; background: color-mix(in srgb, var(--soft) 55%, transparent); padding-right: 14px; }
.cmt-reply::before { content: "↳"; position: absolute; left: 10px; top: 16px; color: var(--sub); font-size: 14px; }
.cmt-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; margin-bottom: 6px; }
.cmt-name { font-weight: 700; color: var(--text-strong); }
.cmt-badge { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: var(--text-strong); color: var(--bg); }
.cmt-badge.lock { background: var(--soft); color: var(--sub); border: 1px solid var(--line); }
.cmt-date, .cmt-edited { font-size: 12px; color: var(--sub); }
.cmt-btns { margin-left: auto; display: flex; gap: 2px; }
.cmt-btns button { border: 0; background: none; color: var(--sub); font-size: 12px; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.cmt-btns button:hover, .cmt-btns button.on { color: var(--text-strong); background: var(--soft); }
.cmt-text { font-size: 15px; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; }
.cmt-locked { color: var(--sub); }
.cmt-deleted .cmt-text, .cmt-deleted .cmt-name { color: var(--sub); opacity: .6; }
.cmt-msg { margin: 0; font-size: 13px; color: #b3261e; }
.cmt-msg:empty { display: none; }
.cmt-empty { color: var(--sub); font-size: 14px; margin: 0 0 20px; }
.cmt-inline { margin-top: 10px; display: grid; gap: 8px; }
.cmt-form { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.cmt-form textarea, .cmt-inline textarea { width: 100%; resize: vertical; min-height: 80px; line-height: 1.6; }
.cmt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmt-row input[type=text], .cmt-row input[type=password] { flex: 1 1 140px; min-width: 0; }
.cmt-submit { justify-content: space-between; }
.cmt-submit .check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sub); }
.cmt-submit .btn { margin-left: auto; }
.cmt-inline .cmt-row { justify-content: flex-end; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 760px) {
  .comments { margin-top: 40px; }
  .comments, .cmt { scroll-margin-top: 150px; }
  .cmt-reply { padding-left: 30px; }
}

/* ---------- 관리자 알림 팝업 (오른쪽 위) ---------- */
/* 알림이 여러 개면(새 버전 · 새 댓글) 위아래로 쌓음 */
.notify-stack {
  position: fixed; top: 76px; right: 16px; z-index: 60;
  width: 320px; max-width: calc(100vw - 32px);
  display: grid; gap: 10px;
}
.notify {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
  padding: 12px 14px 14px;
  animation: nt-in .25s ease-out;
  transition: opacity .2s, transform .2s;
}
@keyframes nt-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notify.out { opacity: 0; transform: translateY(-6px); }
.nt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.nt-head strong { font-size: 14px; color: var(--text-strong); }
.nt-head strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.nt-close { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--sub); cursor: pointer; padding: 2px 4px; }
.nt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.nt-list a { display: grid; gap: 1px; padding: 8px; border-radius: 8px; text-decoration: none; }
.nt-list a:hover { background: var(--soft); }
.nt-post { font-size: 11px; color: var(--accent); }
.nt-body { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.nt-body b { color: var(--text-strong); }
.nt-date { font-size: 11px; color: var(--sub); }
.nt-more { margin: 4px 8px 0; font-size: 12px; color: var(--sub); }
.nt-read { margin-top: 8px; width: 100%; }
.nt-text { margin: 2px 0 0; font-size: 13px; line-height: 1.5; }
.nt-text small { color: var(--sub); }
.nt-go { margin-top: 10px; width: 100%; text-align: center; }
@media (max-width: 760px) {
  /* 모바일: 관리자 버튼 줄 바로 아래, 오른쪽 위 */
  .notify-stack { top: 140px; right: 12px; width: min(320px, calc(100vw - 24px)); }
}

/* 목록: 글 제목 옆 댓글 수 */
.post-item .title .cmt-n { margin-left: 9px; font-size: .70em; font-weight: 500; color: #636363; vertical-align: .12em; letter-spacing: 0; }
/* 다크 모드에서는 어두운 배경에 묻히지 않도록 같은 정도로 흐린 밝은 회색 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .post-item .title .cmt-n { color: #a0a3a9; } }
:root[data-theme="dark"] .post-item .title .cmt-n { color: #a0a3a9; }

/* ---------- 맨 위로 버튼 ---------- */
.to-top {
  position: fixed; right: 18px; bottom: 22px; z-index: 55;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg); color: var(--text-strong);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--soft); }
.page-write .to-top { display: none; }
@media (max-width: 760px) { .to-top { right: 14px; bottom: 18px; width: 42px; height: 42px; } }

/* 사진 정리 미리보기 */
.img-grid { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.img-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* ---------- 설정: 카테고리 옵션 두 개 ---------- */
.cat-row .cat-opts { display: flex; flex-wrap: wrap; gap: 4px 12px; }
@media (max-width: 760px) {
  .cat-row .cat-opts { grid-area: game; }
  .cat-row .cat-opts .check { grid-area: auto; }
}

/* =========================================================
   소설 연재
   ========================================================= */
/* 소설: 카테고리 › 작품명 (일반 글의 카테고리 이름과 같은 포인트 색·크기) */
.nv-crumb { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--accent); }
.nv-crumb a { color: inherit; text-decoration: none; }
.nv-crumb a:hover { text-decoration: none; }
.nv-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 9px; vertical-align: 2px; border: 1px solid var(--line); color: var(--sub); }
.nv-status.s-연재중 { color: #1a8f4c; border-color: color-mix(in srgb, #1a8f4c 40%, transparent); }
.nv-status.s-완결 { color: #3b6fd8; border-color: color-mix(in srgb, #3b6fd8 40%, transparent); }
.nv-status.s-휴재 { color: #b26a00; border-color: color-mix(in srgb, #b26a00 40%, transparent); }

/* 표지 */
.nv-cover, .nv-hero-cover { display: block; object-fit: cover; aspect-ratio: 3 / 4; border-radius: 6px; border: 1px solid var(--line); background: var(--soft); flex: none; }
/* 작품 목록의 표지: 줄거리 길이(카드 높이)와 상관없이 항상 같은 크기 (84×112, 3:4)
   (align-self 가 없으면 카드 높이만큼 세로로 늘어남) */
.nv-cover { width: 84px; height: 112px; align-self: flex-start; }
.nv-hero-cover { width: 168px; }
.nv-cover-empty { display: grid; place-items: center; font-size: 28px; font-weight: 700; color: var(--sub); }
.nv-hero-cover.nv-cover-empty { font-size: 52px; }

/* 작품 목록 */
.nv-works { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.nv-work { display: flex; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; height: 100%; transition: background .15s, border-color .15s; }
.nv-work:hover { background: var(--soft); border-color: color-mix(in srgb, var(--text-strong) 25%, var(--line)); }
.nv-work-txt { display: grid; align-content: start; gap: 6px; min-width: 0; }
.nv-work-title { font-size: 17px; font-weight: 700; color: var(--text-strong); line-height: 1.4; }
.nv-work .nv-status { justify-self: start; } /* 제목 아래 한 줄 따로 */
.nv-work-syn { font-size: 14px; color: var(--sub); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nv-work-meta { font-size: 12px; color: var(--sub); }
.nv-loose { margin-top: 40px; }
.nv-loose h2 { font-size: 15px; color: var(--sub); margin: 0 0 8px; }
.nv-loose ul { margin: 0; padding-left: 1.2em; line-height: 1.9; }
.nv-date { font-size: 12px; color: var(--sub); }

/* 작품 페이지: 소개 + 목차 */
.nv-hero { display: flex; gap: 28px; align-items: flex-start; padding: 8px 0 32px; border-bottom: 2px solid var(--text-strong); }
.nv-hero-txt { min-width: 0; display: grid; gap: 10px; }
.nv-hero h1 { margin: 0; font-size: 28px; line-height: 1.35; color: var(--text-strong); letter-spacing: -0.02em; }
.nv-hero-meta { margin: 0; font-size: 13px; color: var(--sub); }
.nv-hero-meta .nv-status { margin-right: 6px; }
.nv-syn { margin: 4px 0 0; font-size: 15px; line-height: 1.8; color: var(--text); }
/* 두 버튼을 같은 너비로 (더 긴 쪽에 맞춤). 이어 읽기가 숨겨지면 처음부터 읽기만 */
.nv-hero-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 6px; justify-self: start; }
.nv-admin { margin: 2px 0 0; font-size: 13px; color: var(--sub); }
.nv-admin a { color: inherit; }
.nv-toc-h { font-size: 16px; margin: 28px 0 6px; color: var(--text-strong); }
.nv-toc { list-style: none; margin: 0; padding: 0; }
.nv-toc a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.nv-toc a:hover { background: var(--soft); }
.nv-ep-title { color: var(--text-strong); font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 읽던 곳 | 날짜 | 글자 수 | 조회수 — 칸 너비를 고정해 화마다 가로 위치가 같게, 칸 사이는 회색 세로선 */
.nv-toc .nv-ep-meta { display: grid; grid-template-columns: 4.4em 7.7em 5.8em 6.4em; align-items: center; font-size: 12px; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nv-ep-meta > span { text-align: center; line-height: 1.1; }
.nv-ep-meta > span:last-child { text-align: left; padding-left: .8em; } /* 조회수 칸은 왼쪽 정렬 (세로선과 살짝 띄움) */
.nv-ep-meta > .nv-m-date ~ span { border-left: 1px solid var(--line); } /* 세로선은 날짜 뒤 칸(글자 수·조회수) 앞에만 */
.nv-toc a.last-read { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nv-m-last { color: #e8553e; font-weight: 600; } /* "읽던 곳"만 붉은색 (줄 배경은 포인트 색을 연하게 섞은 색 유지, 글씨는 novel.js 가 넣음) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nv-m-last { color: #ff7a63; } }
:root[data-theme="dark"] .nv-m-last { color: #ff7a63; }

/* 회차 읽기 */
.nv-read .post-head { margin-bottom: 36px; }
.nv-read .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.nv-font { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.nv-font button { border: 0; background: none; color: var(--sub); font-size: 13px; padding: 4px 11px; cursor: pointer; line-height: 1.4; }
.nv-font button + button { border-left: 1px solid var(--line); }
.nv-font button:hover { background: var(--soft); color: var(--text-strong); }
.nv-font small { font-size: 11px; margin-left: 1px; }
.nv-entry { --nv-size: 18px; font-size: var(--nv-size); line-height: 1.95; max-width: 680px; margin: 0 auto; }
.nv-entry p { min-height: 1.95em; }
.nv-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin: 56px 0 8px; }
.nv-nav > a, .nv-nav > span { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; min-width: 0; }
.nv-nav > a:hover { background: var(--soft); }
.nv-nav span span, .nv-nav a span { font-size: 12px; color: var(--sub); }
.nv-nav b { font-size: 14.5px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-nav .nv-next { text-align: right; }
.nv-nav .off { opacity: .45; }
.nv-nav .off b { font-weight: 400; }
.nv-nav .nv-toc-btn { place-content: center; font-size: 14px; font-weight: 600; color: var(--text-strong); padding: 16px 22px; }

/* 작품 정보 편집 */
.nv-cover-edit { display: grid; gap: 6px; font-size: 14px; color: var(--sub); }
.nv-cover-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nv-cover-preview { width: 72px; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: var(--soft); font-size: 12px; }
.nv-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.settings-page textarea { width: 100%; resize: vertical; line-height: 1.7; }

@media (max-width: 760px) {
  .nv-works { grid-template-columns: 1fr; }
  .nv-hero { flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .nv-hero-btns { justify-self: center; }
  .nv-hero-cover { width: 140px; }
  .nv-hero h1 { font-size: 24px; }
  .nv-toc a { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  /* 휴대폰 목차: 날짜 | 글자 수 | 조회수 ……… 읽던 곳 (읽던 곳 칸만 맨 뒤, 오른쪽 끝으로) */
  .nv-toc .nv-ep-meta { grid-template-columns: 7.7em 5.8em 6.4em 1fr; }
  .nv-ep-meta > .nv-m-last { order: 1; text-align: right; padding-right: 8px; } /* 읽던 곳은 세로선 없이 줄 오른쪽 끝에 (줄 여백 6px + 8px = 오른쪽 14px) */
  .nv-entry { --nv-size: 17px; }
  .nv-nav { grid-template-columns: 1fr 1fr; }
  .nv-nav .nv-toc-btn { grid-column: 1 / -1; grid-row: 2; }
  /* 휴대폰: 글자 크기 버튼은 날짜·글자 수·조회수(관리자는 수정·삭제까지) 아래 줄로 내려 오른쪽 끝에 */
  .nv-read .post-meta::after { content: ''; flex-basis: 100%; order: 1; }
  .nv-font { order: 2; }
}

/* 폼이 화면 밖으로 삐져나가지 않게: 입력칸 기본 너비(글자 수 기준)가 크게 잡혀도 칸 안에 맞춤
   (휴대폰에서 시스템 글꼴 크기를 키웠을 때 생기던 문제) */
.cmt-form, .cmt-inline, .stack { grid-template-columns: minmax(0, 1fr); }
.cmt-form textarea, .cmt-inline textarea, .cmt-form input, .cmt-inline input,
.stack input, .stack textarea, .stack select { min-width: 0; max-width: 100%; }
.cmt-submit { gap: 8px; }
.cmt-submit .btn { flex: none; }

/* ---------- 헤더 + 사이트 이름 (화면 맨 위, 가로 전체) ----------
   높이는 PC 180px · 휴대폰(760px 이하) 110px 로 고정. 배경색 칸 왼쪽 위 구석에 모서리 장식 그림을
   원본 크기 그대로 붙임 (라이트 모드 transparent.png / 다크 모드 dark.png, public/assets/header/) */
.site-banner { --hd-h: 180px; background: var(--bg); line-height: 0; }
@media (max-width: 760px) { .site-banner { --hd-h: 110px; } }
.site-banner a { display: block; position: relative; height: var(--hd-h); color: inherit; text-decoration: none; }
.site-banner .hd-corner { position: absolute; left: 0; top: 0; display: block; width: auto; height: auto; max-width: 100%; }
/* 지금 모드에 맞는 그림 한 장만 보임 (두 장 모두 아주 작은 PNG) */
.site-banner .hd-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-banner .hd-light { display: none; }
  :root:not([data-theme="light"]) .site-banner .hd-dark { display: block; }
}
:root[data-theme="dark"] .site-banner .hd-light { display: none; }
:root[data-theme="dark"] .site-banner .hd-dark { display: block; }
/* 사이트 이름: 기본 프리텐다드(설정의 글꼴·굵게는 아래 tf-*·tb), 왼쪽 아래. 왼쪽 끝을 본문(PC 는 메뉴 기둥)에 맞춤 */
.site-title { position: absolute; left: 0; right: 0; bottom: 0; line-height: 1.3; pointer-events: none; }
.site-title span, .tf-sample {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 400; letter-spacing: -0.5px; color: var(--text-strong); word-break: keep-all;
}
.site-title span { display: block; max-width: 1000px; margin: 0 auto; padding: 0 20px 18px; font-size: 24px; }
@media (min-width: 1200px) { .site-title span { max-width: 1190px; padding: 0 15px 26px; font-size: 34px; } }
@media (max-width: 760px) { .site-title span { padding: 0 16px 16px; font-size: 20px; } } /* 휴대폰: 긴 사이트 이름도 두 줄 안에 여유 있게 */
/* 설정의 '사이트 이름 정렬': 같은 칸(PC 는 메뉴~본문 폭) 안에서 가운데·오른쪽 끝 */
.site-banner.ta-center .site-title span { text-align: center; }
.site-banner.ta-right .site-title span { text-align: right; }
/* 설정의 '사이트 이름 글꼴' (layout.js 의 tf-*). 기본은 위의 프리텐다드 (굵게면 700).
   .tf-sample = 설정 화면의 미리보기 줄 (글꼴·자간은 위 .site-title span 과 같은 규칙을 씀) */
.tf-sample { margin: 2px 0 4px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); line-height: 1.3; font-size: 28px; overflow-wrap: anywhere; }
/* 설정의 '굵게' (tb): 모든 글꼴 700. 나눔손글씨는 굵은 글꼴이 없어 브라우저가 획을 두껍게 그림(합성 굵게) */
.tb .site-title span, .tf-sample.tb { font-weight: 700; }
/* 설정의 '물결 밑줄' (tw): 포인트 색 물결을 글자 양옆으로 조금 더 길게, 글자 밑으로 넉넉히 띄워 그림.
   글자 줄 밑줄(text-decoration)은 글자 폭을 넘지 못해서, 물결 그림을 마스크로 써서 포인트 색을 칠함 (크기는 글자 크기(em)에 맞춰 늘고 줄어듦) */
.site-title em, .tf-sample em { font-style: inherit; }
.tw .site-title em, .tf-sample.tw em { position: relative; display: inline-block; }
.tw .site-title em::after, .tf-sample.tw em::after {
  content: ""; position: absolute; left: -0.35em; right: -0.35em; bottom: calc(-0.42em + 4px); height: 0.24em;
  background: var(--accent);
  /* 물결 그림 한 장(300번 출렁이는 긴 선)을 가운데 놓고 넘치는 부분은 잘라 씀.
     짧은 그림을 이어 붙이면(repeat) 이음매마다 1px 틈이 비쳐서 한 장으로 바꿈 */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3000 10' preserveAspectRatio='xMidYMid slice'%3E%3Cpath d='M0 5q5-5 10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3C/svg%3E") center / auto 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3000 10' preserveAspectRatio='xMidYMid slice'%3E%3Cpath d='M0 5q5-5 10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0t10 0' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3C/svg%3E") center / auto 100% no-repeat;
}
.tf-sample.tw { padding-bottom: 24px; }
/* 물결 밑줄 색 '사이트 이름 색상' (twc-text): 글자와 같은 색 */
.twc-text .site-title em::after, .tf-sample.twc-text em::after { background: currentColor; }
/* 설정 화면: 물결 밑줄 체크박스와 색 선택 칸을 한 줄로 */
.tw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tw-row select { width: auto; color: var(--sub); }   /* 다른 선택 칸(label 안)과 같은 글자색 */
.tf-maruburi .site-title span, .tf-sample.tf-maruburi { font-family: "MaruBuri", serif; letter-spacing: -0.3px; }
/* 나눔손글씨: 글자가 작아 보이는 만큼 1.3배 */
.tf-hand .site-title span, .tf-sample.tf-hand { letter-spacing: 0; }
.tf-hand .site-title span { font-size: 31px; }
@media (min-width: 1200px) { .tf-hand .site-title span { font-size: 44px; } }
@media (max-width: 760px) { .tf-hand .site-title span { font-size: 26px; } }   /* 휴대폰 손글씨: 기본 글꼴 20px 과 같은 비율(약 1.3배) */
.tf-sample.tf-hand { font-size: 36px; }
.tf-neuris .site-title span, .tf-sample.tf-neuris { font-family: "SiteHand NeuRisNeuRis", "Pretendard Variable", Pretendard, sans-serif; }
.tf-baeeunhye .site-title span, .tf-sample.tf-baeeunhye { font-family: "SiteHand BaeEunHye", "Pretendard Variable", Pretendard, sans-serif; }
.tf-sonpyeonji .site-title span, .tf-sample.tf-sonpyeonji { font-family: "SiteHand SonPyeonJi", "Pretendard Variable", Pretendard, sans-serif; }
.tf-amsterdam .site-title span, .tf-sample.tf-amsterdam { font-family: "SiteHand AmSeuTeReuDam", "Pretendard Variable", Pretendard, sans-serif; }
.tf-dobi .site-title span, .tf-sample.tf-dobi { font-family: "SiteHand HaengBogHanDoBi", "Pretendard Variable", Pretendard, sans-serif; }
/* PC 는 이름 칸 오른쪽 여백(15px)만큼 본문 오른쪽 끝보다 안쪽이라, 오른쪽 정렬일 땐 여백을 빼서 본문 끝에 맞춤 */
@media (min-width: 1200px) { .site-banner.ta-right .site-title span, .site-banner.ta-center .site-title span { padding-right: 0; } }

/* ---------- 글 보기: 읽는 부분(본문·사진·게임 카드)만 760px 가운데 (소설 회차 본문은 .nv-entry 가 따로 680px).
   제목·날짜 줄, 이전/다음 글(회차 이동)·목록, 댓글은 본문 칸 전체(1000px)를 씀  ---------- */
article.post > .entry:not(.nv-entry), article.post > .game-card { max-width: 760px; margin-left: auto; margin-right: auto; }

/* 설정 → 디자인 → 파비콘 미리보기: 브라우저 탭 모양(16px) + 크게(64px) */
.fav-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.fav-tab { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; padding: 7px 12px; border-radius: 8px 8px 0 0; background: var(--bg); border: 1px solid var(--line); border-bottom: 0; font-size: 13px; color: var(--text-strong); }
.fav-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-tab img { flex: none; width: 16px; height: 16px; object-fit: contain; }
.fav-big { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }

/* =========================================================
   소개(프로필) 페이지
   ========================================================= */
.pf-top { text-align: center; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.pf-photo { display: block; width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; object-fit: cover; border: 4px solid #efe8fb; box-sizing: border-box; }
.pf-photo-empty { display: grid; place-items: center; background: var(--soft); color: var(--sub); font-size: 44px; font-weight: 700; }
.pf-eyebrow { margin: 20px 0 4px; font-size: 13px; letter-spacing: 2px; color: var(--accent); }
.pf-name { margin: 0; font-size: 32px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; line-height: 1.35; }
.pf-tagline { margin: 12px 0 0; font-size: 16px; color: color-mix(in srgb, var(--text) 70%, var(--bg)); }
.pf-sec { padding: 40px 0; border-bottom: 1px solid var(--line); }
.pf-sec h2 { margin: 0 0 20px; font-size: 20px; font-weight: 700; color: var(--text-strong); }
.pf-num { color: var(--accent); margin-right: .55em; }
.pf-intro { font-size: 15px; line-height: 1.85; color: color-mix(in srgb, var(--text) 85%, var(--bg)); overflow-wrap: anywhere; }
.pf-likes { margin: 0; font-size: 15px; }
.pf-likes > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, var(--bg)); }
.pf-likes > div:last-child { border-bottom: 0; }
.pf-likes dt { color: var(--accent); font-weight: 700; }
.pf-likes dd { margin: 0; color: color-mix(in srgb, var(--text) 85%, var(--bg)); line-height: 1.7; }
.pf-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 6px; }
.pf-tags li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 14px; border-radius: 20px; font-size: 14px; line-height: 1.7; } /* 색은 아래 '프로필 페이지 색' 규칙 */
/* 기록: 날짜 칸 너비를 가장 긴 날짜에 맞추고(줄마다 정렬 유지) 내용과 충분히 띄움 */
.pf-records { list-style: none; margin: 0; padding: 0; font-size: 15px; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 28px; }
.pf-records li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; padding: 10px 0; }
.pf-year { color: #999; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 48px; }
.pf-records b { color: var(--text-strong); }
.pf-records p { margin: 2px 0 0; color: color-mix(in srgb, var(--text) 85%, var(--bg)); line-height: 1.7; }
@media (max-width: 760px) {
  .pf-name { font-size: 28px; }
  .pf-sec { padding: 32px 0; }
  .pf-likes > div { grid-template-columns: 84px minmax(0, 1fr); }
  .pf-records { column-gap: 18px; }
}

/* 프로필 편집 화면 */
.pe .set-group h2 { display: flex; }
.pe-sec-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; color: var(--text-strong); border: 0 !important; border-bottom: 1px dashed var(--line) !important; border-radius: 0 !important; padding: 4px 0 !important; background: transparent !important; }
.pe-sec-title:focus { outline: none; border-bottom-color: var(--accent) !important; }
.pe-photo { display: grid; justify-items: start; gap: 10px; }
.pe-photo-prev { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--soft); border: 3px solid #efe8fb; font-size: 12px; color: var(--sub); }
.pe-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.pe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pe-row { display: grid; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.pe-like { grid-template-columns: 120px minmax(0, 1fr) auto; }
.pe-rec { grid-template-columns: 90px minmax(0, 1fr) auto; }
.pe-rec-main { display: grid; gap: 6px; min-width: 0; }
.pe-row input, .pe-row textarea { min-width: 0; width: 100%; }
.pe-row textarea { resize: vertical; line-height: 1.6; }
.pe-btns { display: flex; align-items: center; gap: 2px; }
.pe-tags li button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0 0 0 2px; cursor: pointer; opacity: .7; }
.pe-tags li button:hover { opacity: 1; }
.pe-tags:empty { display: none; }
@media (max-width: 760px) {
  .pe-like, .pe-rec { grid-template-columns: minmax(0, 1fr); }
  .pe-btns { justify-content: flex-end; }
}

/* ---------- 색 입력칸 ---------- */
.color-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.color-field .color-label { flex-basis: 100%; font-size: 14px; color: var(--sub); }
.color-field input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.color-field input[type=text] { width: 110px; font-family: Consolas, monospace; text-transform: uppercase; letter-spacing: .03em; }
.color-field input.bad { border-color: #b3261e !important; color: #b3261e; }
.pe-color-preview { display: flex; align-items: center; gap: 16px; margin: 4px 0 0; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.pf-prev-photo { width: 52px; height: 52px; border-radius: 50%; background: var(--soft); border: 4px solid var(--pf-soft, #efe8fb); box-sizing: border-box; }
.pf-prev-tag { display: inline-block; padding: 4px 14px; background: var(--pf-soft, #efe8fb); color: var(--pf-ink, #5a2ead); border-radius: 20px; font-size: 14px; line-height: 1.7; }

/* 프로필 페이지 색을 설정값(--pf-soft / --pf-ink)으로 */
.pf-photo { border-color: var(--pf-soft, #efe8fb); }
.pf-tags li { background: var(--pf-soft, #efe8fb); color: var(--pf-ink, #5a2ead); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pf-tags li, :root:not([data-theme="light"]) .pf-prev-tag {
    background: color-mix(in srgb, var(--pf-ink, #5a2ead) 28%, transparent); color: color-mix(in srgb, var(--pf-ink, #5a2ead) 50%, #fff); }
  :root:not([data-theme="light"]) .pf-photo, :root:not([data-theme="light"]) .pf-prev-photo { border-color: color-mix(in srgb, var(--pf-soft, #efe8fb) 22%, #16171a); }
}
:root[data-theme="dark"] .pf-tags li, :root[data-theme="dark"] .pf-prev-tag {
  background: color-mix(in srgb, var(--pf-ink, #5a2ead) 28%, transparent); color: color-mix(in srgb, var(--pf-ink, #5a2ead) 50%, #fff); }
:root[data-theme="dark"] .pf-photo, :root[data-theme="dark"] .pf-prev-photo { border-color: color-mix(in srgb, var(--pf-soft, #efe8fb) 22%, #16171a); }

/* 첫 페이지(관리자가 "첫 페이지 편집"에서 쓴 내용) */
.home-tools { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.page-home .empty { text-align: center; }
.home-edit-title { font-size: 20px; margin: 0 0 6px; }
