/* 디미백과 Continued
   원칙: 읽기가 먼저. 흰 바탕, 옅은 회색 면, 파란 링크. 강조색(형광 분홍)은 손그림 로고에만 쓴다. */
:root {
  --bg: #fff; --panel: #f6f7f9; --ink: #1f2328; --sub: #4b5563; --muted: #6b7280; --line: #e5e7eb;
  --accent: #f51d94; --link: #0b63ce; --link-soft: #e8f1fd; --new: #c62828; --add: #e6f6ea; --del: #fdecea; --warn: #fff8e1;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "D2Coding", "SF Mono", Menlo, Consolas, monospace;
  --r: 8px; --r-s: 6px; --w: 72rem; --side: 11rem; --gap: 2.5rem; --pad: 1.5rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15171a; --panel: #1e2125; --ink: #e6e8eb; --sub: #b6bcc6; --muted: #9aa1ab; --line: #2c3036; --accent: #ff5cb0; --link: #7db4ff; --link-soft: #1b2a40; --new: #ff8a80; --add: #183222; --del: #3b1d1b; --warn: #332b12; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.75 var(--sans); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--link-soft); }
a { color: var(--link); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
a.wl.new { color: var(--new); }
a.ext::after { content: "↗"; font-size: .72em; margin-left: .15em; opacity: .7; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
.muted { color: var(--muted); font-size: .875rem; }
.small { font-size: .8125rem; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; letter-spacing: -.015em; margin: 2.2em 0 .6em; }
h1 { font-size: 1.85rem; margin: 0; }
h2 { font-size: 1.3rem; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: .8em 0; }

/* ── 머리: 본문과 같은 폭·같은 세로선에 맞춘다 (로고 = 사이드바 열, 검색 = 본문 열) ── */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: var(--gap); max-width: var(--w); margin: 0 auto; height: 3.5rem; padding: 0 var(--pad); }
.logo { display: flex; align-items: center; gap: .35rem; width: var(--side); flex: none; color: var(--ink); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logosvg { height: 2.5rem; width: auto; flex: none; margin-left: -.4rem; }
.logosvg .pink { stroke: var(--accent); }
.biglogo { margin: 0 0 1.5rem -1rem; } .biglogo .logosvg { height: 6.5rem; margin: 0; }
.logo small { font-weight: 500; font-size: .7rem; color: var(--muted); }
.search { display: flex; flex: 1; max-width: 24rem; position: relative; }
.search input { flex: 1; height: 2.25rem; background: var(--panel); border: 1px solid transparent; border-radius: 999px; padding: 0 4rem 0 1rem; font-size: .9rem; }
.search input::placeholder { color: var(--muted); }
.search input:focus { background: var(--bg); border-color: var(--link); outline: 3px solid var(--link-soft); }
.search button { position: absolute; right: 3px; top: 3px; bottom: 3px; border-radius: 999px; padding: 0 .9rem; font-size: .8125rem; }
.acct { display: flex; gap: 1.1rem; align-items: center; font-size: .875rem; margin-left: auto; white-space: nowrap; }
.acct form { display: flex; margin: 0; }
.acct a, .acct button.link { color: var(--muted); line-height: inherit; }
.acct a:hover, .acct button.link:hover { color: var(--ink); text-decoration: none; }
.acct a:first-child { color: var(--ink); font-weight: 600; }

/* ── 뼈대 ── */
.wrap { display: flex; max-width: var(--w); margin: 0 auto; gap: var(--gap); padding: 0 var(--pad); }
.side { width: var(--side); flex: none; padding: 2rem 0; font-size: .9rem; position: sticky; top: 3.5rem; align-self: flex-start; max-height: calc(100vh - 3.5rem); overflow-y: auto; }
.side summary { display: none; }
/* 넓은 화면에서는 항상 펼친다. 좁은 화면에서는 접힌 채로 시작(details 기본 동작) */
@media (min-width: 861px) { .side details::details-content { content-visibility: visible; display: block; } }
.side h4 { font-size: .75rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin: 1.5rem 0 .3rem; }
.side section:first-of-type h4 { margin-top: 0; }
.side ul { list-style: none; margin: 0 0 0 -.6rem; padding: 0; }
.side a { display: block; padding: .24rem .6rem; border-radius: var(--r-s); color: var(--ink); line-height: 1.5; }
.side a:hover { background: var(--panel); text-decoration: none; }
.side a.on { background: var(--panel); font-weight: 600; }
main { flex: 1; min-width: 0; padding: 2rem 0 4.5rem; max-width: 52rem; }
main:has(.editor), .wrap > main:only-child { max-width: none; }
.wrap > main:only-child { margin: 0 auto; }
.wrap > main.narrow { max-width: 24rem; padding-top: 10vh; }
.foot { border-top: 1px solid var(--line); padding: 1.5rem; text-align: center; color: var(--muted); font-size: .8125rem; }

/* 제목, 그 아래 문서 도구 탭 */
.head { margin-bottom: 1.5rem; }
.head:has(.tabs) { border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 1.4rem; font-size: .9rem; flex-wrap: wrap; margin-top: .9rem; }
.tabs a { padding: .4rem 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); font-weight: 600; border-color: var(--ink); }
.tabs.adm { gap: .3rem 1.3rem; margin: -.6rem 0 2rem; border-bottom: 1px solid var(--line); }

/* ── 대문 ── */
.slogan { font-size: 1.05rem; color: var(--muted); margin: .5rem 0 0; }
.lead { font-size: 1.1rem; font-weight: 600; margin: .25rem 0 .5rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.rows time { color: var(--muted); font-size: .8125rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows.ranked { counter-reset: rank; }
.rows.ranked li::before { counter-increment: rank; content: counter(rank); width: 1.2rem; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.rows.ranked li a { flex: 1; }
.more { font-size: .875rem; color: var(--muted); }

.notice { background: var(--panel); border-radius: var(--r); padding: .8rem 1.1rem; margin: 0 0 1.25rem; font-size: .92rem; color: var(--sub); }
.notice.warn { background: var(--warn); color: var(--ink); }
.notice.archive { background: none; border: 1px solid var(--line); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.two h2 { border: 0; padding: 0; font-size: 1.1rem; margin: 2.5rem 0 .3rem; }
.cols { columns: 13rem; column-gap: 2rem; padding-left: 1.1rem; }
.cols li { break-inside: avoid; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: .5rem 1.1rem; margin: 1rem 0; }
.pre { white-space: pre-wrap; }
.tag { display: inline-block; font-size: .72rem; background: var(--panel); color: var(--muted); border-radius: 4px; padding: 0 .4rem; margin-left: .4rem; line-height: 1.7; vertical-align: .08em; }
.bignick { font-size: 1.5rem; font-weight: 700; text-align: center; padding: 1.6rem 1rem; border-radius: var(--r); background: var(--panel); }

/* ── 문서 본문 ── */

.doc::after { content: ""; display: block; clear: both; }
.doc > :first-child { margin-top: 0; }
.doc .secnum { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: .15em; }
.doc .secnum:hover { color: var(--link); text-decoration: none; }
.doc h3 { margin-top: 2em; } .doc h4 { margin-top: 1.6em; }
.doc ul, .doc ol { padding-left: 1.4rem; } .doc li { margin: .2em 0; } .doc li::marker { color: var(--muted); }
code { font-family: var(--mono); font-size: .86em; background: var(--panel); padding: .12em .38em; border-radius: 5px; }
pre { font-family: var(--mono); font-size: .85rem; line-height: 1.6; background: var(--panel); border-radius: var(--r); padding: 1rem 1.15rem; overflow-x: auto; white-space: pre-wrap; margin: 1.1em 0; }
blockquote { margin: 1.1em 0; padding: .05em 1.1em; border-left: 3px solid var(--line); color: var(--sub); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.25rem 0; }
.tablewrap { overflow-x: auto; margin: 1.1em 0; }
table { border-collapse: collapse; }
.wt, .infobox, .kv { font-size: .92rem; }
.wt td, .wt th, .infobox td, .infobox th, .kv td, .kv th { border: 1px solid var(--line); padding: .45rem .8rem; vertical-align: top; text-align: left; }
.wt th, .infobox th, .kv th { background: var(--panel); font-weight: 600; color: var(--sub); }
.kv { margin: 0 0 1.5rem; } .kv th { white-space: nowrap; }
.list { width: 100%; font-size: .9rem; margin: 1em 0; }
.list td, .list th { padding: .6rem .7rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.list thead th { font-size: .78rem; font-weight: 600; color: var(--muted); padding-bottom: .4rem; }
.list tbody tr:hover { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.list tr.current { background: var(--panel); }
.infobox { float: right; clear: right; width: 18.5rem; max-width: 100%; margin: .2rem 0 1.5rem 2rem; }
.infobox caption { font-weight: 700; font-size: 1rem; padding: .6rem; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
.infobox th { width: 34%; }
.toc { display: inline-block; min-width: 13rem; background: var(--panel); border-radius: var(--r); padding: .8rem 1.5rem .9rem 1.1rem; margin: .5rem 0 1rem; font-size: .9rem; }
.toc b { font-size: .78rem; color: var(--muted); font-weight: 600; }
.toc ol { list-style: none; margin: .35rem 0 0; padding: 0; line-height: 1.85; }

.toc .l2 { padding-left: 1.1rem; } .toc .l3 { padding-left: 2.2rem; }
.fnref a { font-size: .78em; font-weight: 600; padding: 0 .1em; }
.footnotes { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: .5rem; font-size: .875rem; color: var(--sub); }
.redirect { font-size: 1.1rem; }
.docfoot { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.docfoot p { margin: .3rem 0; }
.cats { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .875rem; color: var(--muted); margin-bottom: .8rem !important; }
.cats a { background: var(--panel); color: var(--sub); border-radius: 999px; padding: .05rem .8rem; }
.cats a:hover { background: var(--link-soft); color: var(--link); text-decoration: none; }
.actions { display: flex; gap: 1.1rem; font-size: .875rem; } .actions a { color: var(--muted); } .actions a:hover { color: var(--ink); }
.results { list-style: none; padding: 0; margin: 1.5rem 0; }
.results li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.results a { font-weight: 600; font-size: 1.05rem; } .results .muted { margin-top: .2rem; }

/* ── 폼 ── */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: .5rem .75rem; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--link); outline: 3px solid var(--link-soft); }
input[type=checkbox] { accent-color: var(--link); width: 1rem; height: 1rem; padding: 0; }
textarea { width: 100%; font-family: var(--mono); font-size: .875rem; line-height: 1.6; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: var(--r-s); padding: .5rem 1.1rem; cursor: pointer; font-weight: 600; font-size: .9rem; line-height: 1.4; }
button:hover, .btn:hover { opacity: .86; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .btn.ghost:hover { background: var(--panel); opacity: 1; }
button.danger { background: var(--bg); border-color: var(--line); color: var(--new); }
button.danger:hover { background: var(--del); opacity: 1; }
button.link { display: inline; background: none; border: 0; color: var(--link); padding: 0; font-weight: 400; font-size: inherit; }
button.link:hover { text-decoration: underline; opacity: 1; }
.stack { display: grid; gap: .9rem; max-width: 30rem; margin: 1.5rem 0; }
.narrow .stack { max-width: none; } .narrow .stack button { padding: .65rem; }
.stack label { display: grid; gap: .3rem; font-size: .875rem; font-weight: 600; color: var(--sub); }
.stack label input, .stack label select { font-weight: 400; color: var(--ink); }
.stack h3 { margin: 0; }
.stack label.check, .check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.grow { flex: 1; display: flex; gap: .7rem; align-items: center; font-size: .875rem; font-weight: 600; color: var(--sub); white-space: nowrap; } .grow input { flex: 1; font-weight: 400; }
form.inline { display: inline; }
.risk { color: var(--new); font-weight: 700; }
details > summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin: 1.25rem 0 .5rem; }
details > summary:hover { color: var(--ink); }

/* ── 편집기 ── */
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pane { min-width: 0; }
.codewrap { position: relative; height: 68vh; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.codewrap:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--link-soft); }
.codewrap pre, .codewrap textarea { position: absolute; inset: 0; margin: 0; padding: 1rem 1.15rem; border: 0; border-radius: 0; font: .875rem/1.7 var(--mono); white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; overflow: auto; tab-size: 2; background: none; }
.codewrap textarea { resize: none; color: transparent; caret-color: var(--ink); outline: none; }
.codewrap pre { pointer-events: none; }
.t-cat { color: #9a6700; } .t-head { color: var(--accent); font-weight: 700; } .t-link { color: var(--link); } .t-fn { color: #8250df; }
.t-pipe { color: var(--muted); } .t-mark { color: #1a7f37; } .t-code { background: var(--panel); } .t-err { background: var(--del); box-shadow: -1.15rem 0 var(--del), inset 3px 0 var(--new); }
@media (prefers-color-scheme: dark) { .t-cat { color: #d9a441; } .t-fn { color: #c297ff; } .t-mark { color: #6fd08c; } }
.preview { height: 68vh; overflow: auto; background: var(--panel); border-radius: var(--r); padding: 1rem 1.4rem; font-size: .95rem; }
.preview .infobox { width: 15rem; background: var(--bg); } .preview .toc { display: inline-block; min-width: 13rem; background: var(--panel); border-radius: var(--r); padding: .8rem 1.5rem .9rem 1.1rem; margin: .5rem 0 1rem; font-size: .9rem; }
.errors { list-style: none; color: var(--new); padding: 0; margin: .9rem 0 0; font-size: .875rem; }
.errors li { cursor: pointer; padding: .45rem .8rem; background: var(--del); border-radius: var(--r-s); margin-bottom: .35rem; }
.errors b { font-variant-numeric: tabular-nums; margin-right: .4rem; }
.diff { width: 100%; font: .83rem/1.6 var(--mono); border: 1px solid var(--line); border-radius: var(--r); border-collapse: separate; border-spacing: 0; overflow: hidden; margin: 1em 0; }
.diff td { padding: .05rem .7rem; white-space: pre-wrap; } .diff .op { width: 1.6rem; color: var(--muted); user-select: none; text-align: center; }
.diff .add { background: var(--add); } .diff .del { background: var(--del); } .diff .skip td { color: var(--muted); text-align: center; background: var(--panel); }

@media (max-width: 860px) {
  .top { position: static; }
  .top-in { flex-wrap: wrap; height: auto; gap: .6rem 1rem; padding: .7rem 1rem; }
  .logo { width: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .wrap { display: block; padding: 0 1rem; }
  .side { position: static; width: auto; max-height: none; padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .side summary { display: block; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--sub); }
  .side section { display: inline-block; vertical-align: top; width: 48%; margin-top: .8rem; }
  .side h4, .side section:first-of-type h4 { margin: 0 0 .2rem; }
  main { padding: 1.5rem 0 3.5rem; }
  .wrap > main.narrow { padding-top: 2.5rem; }
  .two, .editor { grid-template-columns: 1fr; gap: 1rem; }
  .codewrap, .preview { height: 44vh; }
  .infobox { float: none; width: 100%; margin: 0 0 1.25rem; }
  h1 { font-size: 1.5rem; }
}
