:root {
  /* kkzz 브랜드 색상: branding/KKZZ_BRANDING_SHEET.html 04 */
  --bg: #f6f6ef;
  --box: #ffffff;
  --line: #d9ddd3;
  --text: #171a19;
  --muted: #59615b;
  --accent: #6342c6;
  --accent-bg: #ece8f8;
  --cta: #d5fa43;
  --cta-text: #171a19;
  --danger: #c0392b;
  --ok: #18794e;
  --ok-bg: #e3f4ea;
  --warn-bg: #fff4d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a19;
    --box: #202423;
    --line: #353b38;
    --text: #f6f6ef;
    --muted: #a3aba5;
    --accent: #b9a8f5;
    --accent-bg: #2c2647;
    --danger: #ff8a7a;
    --ok: #6fd3a0;
    --ok-bg: #173526;
    --warn-bg: #3d3319;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Pretendard Variable", Pretendard, Inter, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 19px; margin: 0 0 6px; line-height: 1.4; }
h2 { font-size: 15px; margin: 18px 0 6px; }
p { margin: 6px 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 상단 */
.top { background: var(--box); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.topbar { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; color: var(--text); }
.logo .wordmark { height: 24px; width: auto; display: block; }
.logo:hover { text-decoration: none; }
.search { flex: 1; display: flex; gap: 6px; max-width: 420px; }
.search input { flex: 1; min-width: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs a { padding: 9px 13px; white-space: nowrap; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 700; }

/* 배치 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: start; }
@media (max-width: 800px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.box { background: var(--box); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.pad { padding: 14px 16px; }
.narrow { max-width: 420px; }
.boxhead { margin: 0; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--line); }
.empty { padding: 28px 14px; text-align: center; color: var(--muted); margin: 0; }
.flash { background: var(--accent-bg); color: var(--accent); padding: 9px 14px; border-radius: 8px; margin: 0 0 12px; }
.notice { background: var(--bg); border-radius: 6px; padding: 9px 12px; margin: 10px 16px; font-size: 13px; }
.pad .notice { margin-left: 0; margin-right: 0; }
.notice a { color: var(--accent); }
.notice.warn { background: var(--warn-bg); }
.foot { padding: 16px 12px 32px; text-align: center; }

/* 입력 */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--box); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; max-width: 100%;
}
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn, .search button {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--box); cursor: pointer; white-space: nowrap; line-height: 1.5;
}
.btn:hover, .search button:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--cta-text); font-weight: 600; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.accent { border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.on { background: var(--cta); border-color: var(--cta); color: var(--cta-text); }
.btn.block { display: block; text-align: center; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.link:hover { color: var(--accent); }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack label > * { font-weight: 400; }
.stack .radio { flex-direction: row; align-items: baseline; gap: 6px; font-weight: 400; }
.stack.sub { padding: 12px; background: var(--bg); border-radius: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }

/* 목록 */
.boardhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.boardhead h1 { margin: 0; }
.sorts { display: flex; gap: 4px; }
.sorts a { padding: 3px 10px; border-radius: 999px; color: var(--muted); font-size: 13px; }
.sorts a.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--bg); text-decoration: none; }
.prow:visited .ttext { color: var(--muted); }
.upcount { flex: none; min-width: 40px; text-align: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-bg); border-radius: 5px; padding: 1px 4px; }
.ptitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blabel { color: var(--muted); font-size: 12px; margin-right: 4px; }
.ccount { color: var(--danger); font-size: 12px; margin-left: 3px; }
.media { color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.pmeta { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pmeta.nick { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .pmeta.nick { display: none; } }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); margin-left: 4px; vertical-align: 1px; }
.badge.warn { background: var(--warn-bg); color: var(--danger); border-color: transparent; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.lv { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-bg); border-radius: 4px; padding: 0 5px; }
.pager { display: flex; justify-content: center; gap: 4px; margin-bottom: 12px; }
.pager a { padding: 4px 10px; border-radius: 6px; background: var(--box); border: 1px solid var(--line); }
.pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 게시물 */
.posthead { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.postbody { padding: 16px; }
.postbody img { max-width: 100%; height: auto; border-radius: 6px; }
.postbody .text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.8; }
.video { position: relative; padding-top: 56.25%; margin-bottom: 12px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px 12px; }
.actions .vote { min-width: 84px; padding: 9px 14px; }
.share { margin: 12px 16px; padding: 12px 14px; background: var(--bg); border-radius: 8px; }
.share h2 { margin-top: 0; }
.share textarea { font: 12px/1.5 ui-monospace, Menlo, monospace; }
.postfoot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.postfoot summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.postfoot .stack { margin-top: 8px; gap: 6px; }

/* 댓글 */
.comment { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.comment.reply { padding-left: 38px; background: var(--bg); }
.chead { margin: 0; }
.cbody { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ctools { display: flex; gap: 12px; align-items: flex-start; }
.ctools summary { cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; }
.ctools details[open] { flex: 1; }
.bestc { background: var(--ok-bg); }
.bestc .comment { border-bottom-color: transparent; padding: 6px 14px; }
.cform { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; }
.ctools .cform { padding: 6px 0 0; }

/* 옆단 */
aside .me { font-weight: 700; margin: 0; }
.hot { margin: 0; padding: 8px 14px 8px 34px; font-size: 13px; }
.hot li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
aside a { color: inherit; }
aside .small a { color: var(--accent); }

/* 수익 */
.paywall { margin: 16px 0; padding: 18px; text-align: center; background: var(--bg); border-radius: 8px; border: 1px dashed var(--line); }
.shopline { margin-top: 16px; padding: 10px 12px; background: var(--bg); border-radius: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shopline .btn { margin-left: auto; }
.bignum { font-size: 28px; font-weight: 800; margin: 8px 0; }
.cards .bignum { font-size: 22px; margin: 2px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.card { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.card p { margin: 0; }
.card .num { font-size: 18px; font-weight: 700; }

.adslot { margin: 0 16px 12px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13px; color: var(--muted); }
.copyrow { display: flex; gap: 6px; margin: 6px 0; }
.copyrow input { flex: 1; min-width: 0; font: 12px/1.5 ui-monospace, Menlo, monospace; }

/* 기타 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.plain { padding-left: 18px; margin: 8px 0; }
.code { font: 15px/1.5 ui-monospace, Menlo, monospace; background: var(--bg); padding: 10px 12px; border-radius: 6px; user-select: all; overflow-wrap: anywhere; }

/* 창작 작품 */
.textlink { color: var(--accent); }
.subhead { margin: 0; padding: 10px 14px 0; font-size: 13px; }
.nomargin { margin: 0; padding-bottom: 0; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px 12px; padding: 12px 14px 14px; }
.scard { display: flex; flex-direction: column; min-width: 0; }
.scard:hover { text-decoration: none; }
.scard:hover .stitle { text-decoration: underline; }
.scover { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden;
  background: var(--accent-bg); color: var(--accent); font-size: 34px; font-weight: 800; }
.scover img { width: 100%; height: 100%; object-fit: cover; }
.stitle { font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shead { display: flex; gap: 16px; padding: 16px; }
.shead .scover { flex: none; width: 132px; align-self: flex-start; }
.sinfo { min-width: 0; flex: 1; }
.sdesc { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; }
@media (max-width: 520px) { .shead .scover { width: 92px; } }
.postbody .cuts { margin: 0 -16px 16px; }
.postbody .cuts img { display: block; width: 100%; max-width: 690px; margin: 0 auto; border-radius: 0; }
.postbody .text.novel { max-width: 640px; margin: 8px auto; font-size: 16px; line-height: 2; }
.postbody .text.authornote { max-width: 690px; margin: 0 auto; padding: 10px 12px; background: var(--bg); border-radius: 6px; font-size: 13px; }
.epnav { display: flex; justify-content: space-between; gap: 8px; padding: 0 16px 14px; }
.btn.off { color: var(--muted); cursor: default; }
.btn.off:hover { background: var(--box); }
.prow.unread { background: var(--accent-bg); }
.prow.unread .ttext { font-weight: 600; }
.epnav .row { margin-top: 0; }

/* 관리자 */
.adminbar { background: var(--box); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.adminmark { font-size: 12px; font-weight: 700; color: var(--box); background: var(--text); border-radius: 4px; padding: 1px 6px; vertical-align: 3px; letter-spacing: 0; }
.spacer { flex: 1; }
.adminlayout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: start; padding-bottom: 32px; }
.adminnav { display: flex; flex-direction: column; background: var(--box); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.adminnav a { padding: 9px 14px; color: var(--muted); border-left: 3px solid transparent; }
.adminnav a:hover { text-decoration: none; background: var(--bg); color: var(--text); }
.adminnav a.on { color: var(--accent); font-weight: 700; border-left-color: var(--accent); background: var(--accent-bg); }
.adminnav .count { font-size: 11px; color: #fff; background: var(--danger); border-radius: 999px; padding: 0 6px; }
@media (max-width: 720px) {
  .adminlayout { grid-template-columns: minmax(0, 1fr); }
  .adminnav { flex-direction: row; overflow-x: auto; }
  .adminnav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .adminnav a.on { border-bottom-color: var(--accent); }
}
h2.first { margin-top: 0; }
.setgrid { display: flex; flex-direction: column; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setname { display: flex; flex-direction: column; min-width: 0; }
.setinput { flex: none; white-space: nowrap; color: var(--muted); }
.setinput input { width: 110px; text-align: right; color: var(--text); }
.savebar { position: sticky; bottom: 0; margin: 0; padding: 10px 0; background: var(--bg); text-align: right; }
.bad { color: var(--danger); font-weight: 600; }
.scrollx { overflow-x: auto; }
.keytext { font: 12px/1.5 ui-monospace, Menlo, monospace; overflow-wrap: anywhere; user-select: all; }

/* 외부 로그인 */
.social { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; }
.social .btn { padding: 9px 12px; font-weight: 600; }
.social-kakao { background: #fee500; border-color: #fee500; color: #191600; }
.social-kakao:hover { background: #fee500; filter: brightness(0.96); }
.social-google { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.social-google:hover { background: #f6f7f8; }
.or { text-align: center; margin: 12px 0; }

/* 컷 올리기 */
.cutlist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: cut; }
.cutlist li { counter-increment: cut; width: 92px; text-align: center; font-size: 12px; }
.cutlist li::before { content: counter(cut) "컷"; display: block; color: var(--muted); }
.cutlist img { display: block; width: 92px; height: 92px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
button:disabled { opacity: 0.5; cursor: default; }

/* 안내 문서 */
.doc { max-width: 720px; }
.doc h2 { margin-top: 22px; }
.doc li { margin: 4px 0; }
