/* INCHAE 백과 — 3D 화면(css/style.css)과 같은 판: 무채색, 단추 32·모서리 8, 흐림 없음 */
:root {
  --bg: #0c0d0f; --s1: #141518; --s2: #1b1c20; --s3: #24262b;
  --line: #26282d; --line-2: #33353b;
  --t1: #ececee; --t2: #a2a5ad; --t3: #6c6f77;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --top: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--t1); font-family: var(--font); font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.n { margin-left: 6px; color: var(--t3); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
kbd { font: 500 11px/18px var(--font); color: var(--t3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }

/* 위 막대 */
.top { position: sticky; top: 0; z-index: 10; height: var(--top); background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px; }
.brand { font-family: Montserrat, var(--font); font-weight: 900; font-size: 19px; letter-spacing: .08em; text-decoration: none; }
.tnav { display: flex; gap: 4px; }
.tnav a { height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; color: var(--t2); text-decoration: none; font-size: 14px; font-weight: 600; }
.tnav a:hover { background: var(--s2); color: var(--t1); }
.tnav a[aria-current] { color: var(--t1); }
.top .sbox { margin-left: auto; width: 280px; }

/* 찾기 */
.sbox { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; background: var(--s1); border: 1px solid var(--line); border-radius: 8px; color: var(--t3); }
.sbox:focus-within { border-color: var(--line-2); background: var(--s2); }
.sbox input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--t1); font: inherit; font-size: 14px; }
.sbox input::-webkit-search-cancel-button { display: none; }
.sbox.big { height: 52px; padding: 0 16px; gap: 12px; }
.sbox.big input { font-size: 16px; }
.sres { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); max-height: min(440px, 70vh); overflow: auto; background: var(--s1); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; z-index: 20; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.top .sres { left: auto; width: 380px; }
.sres a { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--t1); }
.sres a b { font-weight: 600; font-size: 15px; white-space: nowrap; flex: none; }
.sres a span { color: var(--t3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sres a em { margin-left: auto; font-style: normal; color: var(--t3); font-size: 12px; white-space: nowrap; }
.sres a.on, .sres a:hover { background: var(--s3); }
.sres .none { padding: 12px 10px; color: var(--t3); font-size: 14px; }

/* 옆 차례 (항목·목차 공통) */
.art-wrap, .idx-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; }
.toc-side, .sys-side { position: relative; }
.toc-in { position: sticky; top: calc(var(--top) + 28px); padding-top: 36px; max-height: calc(100vh - var(--top) - 40px); overflow: auto; }
.toc-t { font-size: 11px; font-weight: 600; color: var(--t3); margin: 0 0 8px 10px; }
.toc-in ol { list-style: none; margin: 0; padding: 0; }
.toc-in li a { display: flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 8px; color: var(--t2); text-decoration: none; font-size: 14px; line-height: 1.4; }
.toc-in li a:hover { background: var(--s1); color: var(--t1); }
.toc-in li a.on { background: var(--s2); color: var(--t1); font-weight: 600; }
.toc-in .n { margin-left: auto; }

/* 스위치 */
.sw { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 13px; color: var(--t2); cursor: pointer; user-select: none; }
.sw input { position: absolute; opacity: 0; }
.sw span { position: relative; width: 30px; height: 18px; border-radius: 9px; background: var(--s3); border: 1px solid var(--line-2); transition: background .2s; flex: none; }
.sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--t2); transition: transform .2s, background .2s; }
.sw input:checked + span { background: var(--t2); }
.sw input:checked + span::after { transform: translateX(12px); background: var(--bg); }
.sw input:focus-visible + span { outline: 2px solid var(--t2); outline-offset: 2px; }

/* 단추 */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--s1); color: var(--t1); font: 600 13.5px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--s2); }
.btn.pri { background: var(--t1); border-color: var(--t1); color: var(--bg); }
.btn.pri:hover { background: #fff; }

/* 항목 */
.art { max-width: 760px; padding: 28px 0 64px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--t3); display: flex; flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--t2); text-decoration: none; } .crumbs a:hover { color: var(--t1); }
.crumbs .sep { margin: 0 7px; color: var(--line-2); }
.art-h { padding: 14px 0 22px; border-bottom: 1px solid var(--line); }
.art-h h1 { font-size: 36px; line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.kh { color: var(--t2); font-size: 17px; margin-top: 4px; }
.terms { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 13.5px; color: var(--t2); }
.terms em { font-style: normal; color: var(--t3); margin-right: 6px; font-size: 12px; }
.acts { display: flex; gap: 8px; margin-top: 18px; }
.toc-top { display: none; }

.art section { margin-top: 32px; }
.art h2 { font-size: 19px; line-height: 1.4; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; }
.art p { margin: 0 0 12px; color: #dcdee3; }
.art ul, .art ol { margin: 0 0 12px; padding-left: 20px; }
.art li { color: #dcdee3; margin: 4px 0; }
.art li::marker { color: var(--t3); }
.art b { color: var(--t1); font-weight: 650; }
.art a.xl { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.art a.xl:hover { text-decoration-color: var(--t2); }
.sum { font-size: 17.5px; line-height: 1.8; color: var(--t1) !important; }

.keybox { background: var(--s2); border-left: 2px solid var(--t2); border-radius: 0 8px 8px 0; padding: 14px 18px 12px; }
.keybox h2 { font-size: 11px; font-weight: 600; color: var(--t3); margin-bottom: 6px; letter-spacing: 0; }
.keybox ul { margin: 0; padding-left: 18px; }
.keybox li { color: var(--t1); font-size: 15.5px; margin: 3px 0; }

.facts { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.facts > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; padding: 11px 16px; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts > div:nth-child(odd) { background: var(--s1); }
.facts dt { color: var(--t3); font-size: 13.5px; font-weight: 600; padding-top: 1px; }
.facts dd { margin: 0; font-size: 15px; line-height: 1.7; color: #dcdee3; }

.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gal figure { margin: 0; }
.gal figure > a { display: block; border-radius: 8px; overflow: hidden; background: #f3f2ef; border: 1px solid var(--line); }
.gal img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; transition: transform .3s; }
.gal figure > a:hover img { transform: scale(1.03); }
.gal figcaption { font-size: 13px; color: var(--t2); line-height: 1.5; margin-top: 8px; }
.gal small { display: block; color: var(--t3); font-size: 11.5px; margin-top: 2px; }
.gal small a { color: var(--t2); }

.kids { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 16px; }
.kids li { margin: 0; } .kids a { text-decoration: none; color: var(--t1); font-size: 15px; } .kids a:hover { text-decoration: underline; }
.kids li.B a { color: var(--t2); }
.refs { padding-top: 18px; border-top: 1px solid var(--line); }
.refs h2 { font-size: 13px !important; color: var(--t3); font-weight: 600 !important; }
.refs li { font-size: 13.5px; color: var(--t2); margin: 2px 0; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; }
.pn a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--t1); font-weight: 600; font-size: 15px; min-width: 0; }
.pn a:hover { background: var(--s1); border-color: var(--line-2); }
.pn a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn small { display: block; font-size: 12px; color: var(--t3); font-weight: 500; }
.pn .next { justify-content: flex-end; text-align: right; grid-column: 2; }
.pn .ic { color: var(--t3); }

/* 그림 크게 보기 */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(6, 7, 8, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 20px 20px; }
.lb img { max-width: 100%; max-height: calc(100vh - 140px); background: #f3f2ef; border-radius: 8px; }
.lb p { color: var(--t2); font-size: 14px; margin: 12px 0 0; text-align: center; max-width: 720px; }
.lb button { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-2); background: var(--s1); color: var(--t1); cursor: pointer; }

/* 목차 */
.idx { padding: 0 0 64px; min-width: 0; }
.hero { padding: 44px 0 28px; }
.hero h1 { font-size: 38px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.02em; }
.lead { color: var(--t2); font-size: 16.5px; margin: 0 0 22px; max-width: 640px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.card { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--s1); text-decoration: none; transition: border-color .15s, background .15s; }
.card:hover { border-color: var(--line-2); background: var(--s2); }
.card-h { display: flex; align-items: baseline; } .card-h b { font-size: 16px; font-weight: 700; }
.card p { margin: 4px 0 10px; font-size: 13.5px; color: var(--t2); line-height: 1.55; }
.card .ex { font-size: 12.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sys { padding-top: 36px; }
.sys h2 { display: flex; align-items: baseline; font-size: 22px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); letter-spacing: -.01em; }
.grps { columns: 2; column-gap: 40px; }
.grp { break-inside: avoid; margin-bottom: 22px; }
.grp h3 { display: flex; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--t3); margin: 0 0 6px; }
.grp ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.grp li { font-size: 15px; line-height: 1.85; }
.grp li a { text-decoration: none; color: var(--t1); } .grp li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.grp li.B a { color: var(--t2); }
.more { margin-top: 4px; height: 28px; padding: 0 8px; margin-left: -8px; border: 0; border-radius: 8px; background: none; color: var(--t3); font: 500 13px var(--font); cursor: pointer; }
.more:hover { background: var(--s1); color: var(--t2); }
/* 작은 구조(B)는 처음엔 접어 둔다 */
body:not(.showB) .grp li.B:not(.open), body:not(.showB) .grp.onlyB { display: none; }
body.showB .more, .grp.opened .more { display: none; }
.grp.opened li.B { display: list-item !important; }

.foot { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; font-size: 12px; line-height: 1.7; color: var(--t3); border-top: 1px solid var(--line); }

/* 좁은 화면 */
@media (max-width: 1020px) {
  .art-wrap, .idx-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc-side, .sys-side { display: none; }
  .art { width: 100%; margin: 0 auto; }
  .toc-top { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--top); z-index: 5; background: var(--bg); margin: 0 -20px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
  .toc-top::-webkit-scrollbar { display: none; }
  .toc-top a { flex: none; height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; color: var(--t2); text-decoration: none; font-size: 13.5px; }
  .toc-top a.on { background: var(--s2); color: var(--t1); font-weight: 600; }
  html { scroll-padding-top: calc(var(--top) + 64px); }
}
@media (max-width: 720px) {
  .top-in { gap: 12px; padding: 0 16px; }
  .tnav a { padding: 0 8px; }
  .top .sbox { width: auto; flex: 1; min-width: 0; }
  .top .sbox kbd { display: none; }
  .top .sres { position: fixed; left: 12px; right: 12px; width: auto; top: calc(var(--top) + 4px); }
  .art-wrap, .idx-wrap { padding: 0 16px; }
  .toc-top { margin: 0 -16px; padding: 8px 16px; }
  .art-h h1 { font-size: 29px; }
  .hero { padding-top: 28px; } .hero h1 { font-size: 30px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card p { display: none; }
  .grps { columns: 1; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .pn { grid-template-columns: 1fr; } .pn .next { grid-column: 1; }
  .sum { font-size: 16.5px; }
}
@media (max-width: 420px) { .tnav a:last-child { display: none; } }

/* 참고 영상(유튜브) — 썸네일 + 제목 두 줄 + 채널, 누르면 #vp 창에서 재생 */
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 16px; margin-top: 4px; }
.vid { display: grid; gap: 8px; color: var(--t1); text-decoration: none; }
.vid .th { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--s2); }
.vid .th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.vid:hover .th img { transform: scale(1.03); }
.vid .th i { position: absolute; right: 6px; bottom: 6px; padding: 0 5px; border-radius: 4px; background: rgba(0,0,0,.8); font: 600 11px/18px var(--font); font-style: normal; color: #fff; }
.vid .vt { display: grid; gap: 4px; }
.vid b { font-size: 14px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid small { font-size: 12px; color: var(--t3); display: flex; gap: 6px; align-items: center; }
.vid em { font-style: normal; font-size: 11px; color: var(--t2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.vnote { margin-top: 12px; font-size: 12px; color: var(--t3); }
#vp { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 56px 64px 24px; background: rgba(8, 9, 10, 0.94); }
#vp[hidden] { display: none; }
#vp .vp-in { width: min(1100px, 100%); aspect-ratio: 16 / 9; max-height: calc(100vh - 100px); background: #000; border-radius: 8px; overflow: hidden; }
#vp iframe { width: 100%; height: 100%; border: 0; display: block; }
#vp .vp-x { position: fixed; top: 12px; right: 12px; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--s1); color: var(--t1); font-size: 14px; cursor: pointer; }
@media (max-width: 860px) { .vids { grid-template-columns: 1fr; } #vp { padding: 56px 8px 16px; } }
