/* AVATARMECHA 제품 문서(wiki) 화면 — tools/wiki/theme/wiki.css (build.js 가 wiki/assets 로 복사) */
:root {
  --navy: #1e2440; --navy-2: #343c62; --green: #25d560; --green-d: #17a84a;
  --blue: #2f6fd0; --blue-d: #1b4a93; --blue-l: #eaf2fd;
  --ink: #15202b; --muted: #5b6b7b; --line: #e3e8ef; --surface: #f5f7fa; --bg: #fff;
  --amber: #c97b1a; --red: #c8394b; --ok: #1d9e75;
  --top: 56px; --side: 292px; --toc: 232px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body.wk { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 16px; }
.wk a { color: var(--blue); }
.wk a:hover { color: var(--blue-d); }
.skip { position: absolute; left: -9999px; top: 0; background: #fff; color: var(--ink); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- 위쪽 줄 ---------- */
.wk-top { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.wk-logo { display: flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.wk-logo b { color: var(--green); font-weight: 800; }
.wk-links { display: flex; gap: 4px; margin-left: 6px; }
.wk-links a { color: rgba(255, 255, 255, .78); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.wk-links a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.wk-search { margin-left: auto; position: relative; width: min(360px, 38vw); }
.wk-search input { width: 100%; height: 36px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff; padding: 0 16px; font: inherit; font-size: 14px; }
.wk-search input::placeholder { color: rgba(255, 255, 255, .6); }
.wk-search input:focus { outline: 2px solid var(--green); background: rgba(255, 255, 255, .16); }
.wk-results { position: absolute; top: 44px; right: 0; width: min(520px, 92vw); max-height: 70vh; overflow: auto; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 14px 40px rgba(17, 19, 24, .22); border: 1px solid var(--line); }
.wk-results a { display: block; padding: 11px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.wk-results a:last-child { border-bottom: 0; }
.wk-results a:hover, .wk-results a.on { background: var(--blue-l); }
.wk-results b { display: block; font-size: 15px; }
.wk-results small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wk-results mark { background: #fff1b8; color: inherit; border-radius: 3px; }
.wk-results p { margin: 0; padding: 14px 16px; color: var(--muted); font-size: 14px; }
.wk-menu { display: none; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }

/* ---------- 3단 배치 ---------- */
.wk-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); max-width: 1560px; margin: 0 auto; }
.wk-side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 18px 14px 40px; }
.wk-prod-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink) !important; padding: 4px 6px 14px; }
.wk-prod-link img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.wk-prod-link b { display: block; font-size: 17px; line-height: 1.25; }
.wk-prod-link small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.wk-ver { display: grid; gap: 4px; padding: 0 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.wk-ver span { font-size: 12px; font-weight: 700; color: var(--muted); }
.wk-ver select { height: 38px; border-radius: 10px; border: 1px solid #cfd6e0; background: #fff; font: inherit; font-size: 14px; padding: 0 10px; color: var(--ink); }
.wk-tree ul { list-style: none; margin: 0; padding: 0; }
.wk-tree ul ul { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.wk-tree a, .wk-tree summary span { display: block; padding: 7px 10px; border-radius: 8px; color: #2a3646; text-decoration: none; font-size: 14.5px; line-height: 1.4; }
.wk-tree a:hover { background: #e9edf4; color: var(--ink); }
.wk-tree a[aria-current="page"] { background: #fff; color: var(--blue-d); font-weight: 700; box-shadow: inset 3px 0 0 var(--green), 0 1px 2px rgba(17, 19, 24, .06); }
.wk-tree .wk-home { font-weight: 700; margin-bottom: 4px; }
.wk-tree summary { display: flex; align-items: center; cursor: pointer; list-style: none; border-radius: 8px; }
.wk-tree summary::-webkit-details-marker { display: none; }
.wk-tree summary::before { content: "▸"; color: #8a96a8; font-size: 12px; width: 18px; text-align: center; transition: transform .15s; flex-shrink: 0; }
.wk-tree details[open] > summary::before { transform: rotate(90deg); }
.wk-tree summary a, .wk-tree summary span { flex: 1; font-weight: 700; color: var(--ink); }
.wk-tree summary:hover { background: #e9edf4; }

.wk-main { padding: 28px clamp(18px, 4vw, 56px) 60px; min-width: 0; }
.wk-single { max-width: 980px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 40px) 60px; }
.wk-toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 16px 40px 8px; font-size: 13.5px; }
.wk-toc h2 { font-size: 12px; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; text-transform: none; }
.wk-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.wk-toc li a { display: block; padding: 4px 12px; margin-left: -2px; border-left: 2px solid transparent; color: #4a5565; text-decoration: none; line-height: 1.4; }
.wk-toc li.l3 a { padding-left: 24px; font-size: 13px; }
.wk-toc li a:hover { color: var(--ink); }
.wk-toc li a.on { color: var(--blue-d); border-left-color: var(--green); font-weight: 700; }

/* ---------- 본문 ---------- */
.wk-bc { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.wk-bc a { color: var(--muted); text-decoration: none; }
.wk-bc a:hover { color: var(--blue-d); text-decoration: underline; }
.wk-bc i { font-style: normal; color: #aab4c2; }
.wk-bc span { color: var(--ink); font-weight: 600; }
.wk-banner { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; background: #fff8eb; border: 1px solid #f1d9a8; color: #6b4a10; }
.wk-banner.legacy { background: #fef2f3; border-color: #f0c2c8; color: #7a2331; }
.wk-banner.draft { background: #eef0ff; border-color: #c9ceff; color: #2c3180; }
.doc { max-width: 860px; }
.doc-kicker { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: .04em; }
.doc h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
.doc-meta, .doc-tag { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.doc-head { padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.doc-head.home { display: flex; gap: 18px; align-items: center; }
.doc-icon { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.doc h2 { font-size: 23px; line-height: 1.35; margin: 40px 0 12px; padding-top: 6px; letter-spacing: -.005em; }
.doc h3 { font-size: 18px; line-height: 1.4; margin: 28px 0 8px; }
.doc h4 { font-size: 16px; margin: 22px 0 6px; }
.doc .anchor { margin-left: 8px; font-size: .75em; color: #b8c1ce; text-decoration: none; opacity: 0; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc li > ul, .doc li > ol { margin: 4px 0; }
.doc img { max-width: 100%; height: auto; border-radius: 8px; }
.doc video { max-width: 100%; height: auto; border-radius: 10px; background: #000; }
.doc code { background: #f0f3f8; padding: 1px 7px; border-radius: 5px; font-size: .9em; color: #b02a3a; font-family: ui-monospace, Consolas, "Courier New", monospace; }
.doc pre { background: #101828; color: #e6edf7; padding: 14px 16px; border-radius: 10px; overflow: auto; font-size: 14px; line-height: 1.55; }
.doc pre code { background: none; color: inherit; padding: 0; }
.doc blockquote { margin: 0 0 14px; padding: 4px 16px; border-left: 4px solid var(--line); color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.doc kbd { border: 1px solid #c8d0dc; border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: #fff; font-size: .88em; font-family: inherit; }
.doc details { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin: 0 0 12px; }
.doc details > summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.doc details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th { background: #f0f5ff; color: var(--blue-d); font-weight: 700; padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--line); vertical-align: top; }
.doc td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: #3d4b5c; vertical-align: top; }
.doc table.kv th { width: 24%; min-width: 110px; border-bottom: 1px solid var(--line); background: #f7faff; white-space: nowrap; }
.doc table.kv td { color: var(--ink); }

.doc thead th { white-space: nowrap; }
.badge { white-space: nowrap; display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; vertical-align: middle; line-height: 1.5; }
.badge.blue { background: var(--blue-l); color: var(--blue-d); }
.badge.green { background: #e1f5ee; color: #0f6e56; }
.badge.amber { background: #faeeda; color: #854f0b; }
.badge.purple { background: #f3e8ff; color: #6b21a8; }
.badge.pink { background: #fde8ef; color: #9b1c3a; }
.badge.teal { background: #daeefa; color: #0a547a; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.gray { background: #eceff3; color: #4a5565; }

.callout { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 13px 16px; margin: 16px 0; font-size: 15px; border-left: 4px solid var(--blue); background: var(--blue-l); }
.callout .ico { font-size: 18px; line-height: 1.5; flex-shrink: 0; }
.callout .cbody { flex: 1; min-width: 0; }
.callout .cbody > :last-child { margin-bottom: 0; }
.callout .ctitle { display: block; margin-bottom: 2px; }
.callout.warn { background: #fff8eb; border-left-color: var(--amber); }
.callout.danger { background: #fef2f3; border-left-color: var(--red); }
.callout.ok { background: #e8f8f3; border-left-color: var(--ok); }
.callout.note { background: #f3f5f8; border-left-color: #8a96a8; }

ol.steps { list-style: none; counter-reset: step; padding-left: 0; margin: 14px 0 18px; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 42px; margin: 0 0 16px; min-height: 28px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
ol.steps > li > strong:first-child { display: block; font-size: 15.5px; margin-bottom: 2px; }
ol.steps > li { color: #3d4b5c; font-size: 15px; }

.cards { display: grid; gap: 12px; margin: 14px 0 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.card h3 { margin: 6px 0 4px; font-size: 15.5px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); }
.card .badge { margin-bottom: 2px; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 14px 0 18px; }
.figs figure { margin: 0; }
.figs img { width: 100%; background: #000; border: 1px solid #333; border-radius: 8px; }
.figs figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.doc-children { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-children li { margin: 0; }
.doc-children a, .doc-children span { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); height: 100%; }
.doc-children a:hover { border-color: var(--blue); background: var(--blue-l); }
.doc-children b { display: block; font-size: 15.5px; }
.doc-children small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 2px; }

.btn { display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border-radius: 21px; background: var(--green); color: var(--navy) !important; font-weight: 700; text-decoration: none; font-size: 15px; border: 2px solid var(--green); }
.btn:hover { background: var(--green-d); border-color: var(--green-d); }
.btn.line { background: transparent; color: var(--ink) !important; border-color: #cfd6e0; }
.btn.line:hover { background: var(--surface); border-color: #aab4c2; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.doc-note { color: var(--muted); font-size: 14px; margin-top: 18px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 8px; }
.pcard { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; text-decoration: none; color: var(--ink) !important; background: #fff; }
.pcard:hover { border-color: var(--blue); box-shadow: 0 8px 24px rgba(17, 19, 24, .08); }
.pcard img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.pcard b { display: block; font-size: 18px; }
.pcard small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.pcard em { display: inline-block; margin-top: 4px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--green-d); }

.wk-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 860px; margin: 40px 0 0; }
.wk-pn a { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.wk-pn a:hover { border-color: var(--blue); background: var(--blue-l); }
.wk-pn small { display: block; color: var(--muted); font-size: 12.5px; }
.wk-pn span { font-weight: 700; }
.wk-pn .next { text-align: right; grid-column: 2; }
.wk-foot { max-width: 860px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.wk-foot p { margin: 0 0 6px; }
.wk-foot-links a { margin-right: 14px; }

/* ---------- 화면 크기 ---------- */
@media (max-width: 1180px) {
  .wk-shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .wk-toc { display: none; }
}
@media (max-width: 860px) {
  .wk-shell { display: block; }
  .wk-menu { display: inline-block; }
  .wk-links { display: none; }
  .wk-top { padding: 0 12px; gap: 10px; }
  .wk-search { width: auto; flex: 1; }
  .wk-side { position: fixed; z-index: 30; left: 0; top: var(--top); bottom: 0; width: min(88vw, 340px); height: auto; transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(17, 19, 24, .3); }
  body.nav-open .wk-side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(17, 19, 24, .4); z-index: 20; }
  .wk-main { padding: 20px 16px 48px; }
  .cards, .cards.cols-3, .doc-children { grid-template-columns: 1fr; }
  .doc h2 { font-size: 21px; }
  .wk-pn { grid-template-columns: 1fr; }
  .wk-pn .next { grid-column: 1; }
  .doc-head.home { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .wk-logo span { display: none; }
  .card { padding: 13px 15px; }
  .doc h1 { font-size: 25px; }
}
@media print {
  .wk-top, .wk-side, .wk-toc, .wk-pn, .wk-foot, .wk-banner { display: none !important; }
  .wk-shell { display: block; }
  .wk-main { padding: 0; }
  .doc a { color: inherit; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- 언어 고르기 · 언어별 글꼴 ---------- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wk-lang { margin-left: 12px; flex: none; }
.wk-lang select { height: 34px; border-radius: 17px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1); color: #fff; padding: 0 12px; font: inherit; font-size: 14px; cursor: pointer; }
.wk-lang select:focus { outline: 2px solid var(--green); }
.wk-lang option { color: #15202b; background: #fff; }
.wk-search + .wk-lang { margin-left: 12px; }
.wk-top .wk-links + .wk-lang { margin-left: auto; }
html:lang(ja) body.wk { --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; }
html:lang(zh-CN) body.wk { --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
html:lang(vi) body.wk { --font: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
html:lang(en) body.wk { --font: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
@media (max-width: 760px) { .wk-lang { margin-left: 6px; } .wk-lang select { padding: 0 8px; font-size: 13px; } }
