/* 이드봇 문서 — Notion 풍 사이드바 레이아웃.
   원칙: 장식 최소화, 애니메이션은 hover 색 변화 정도만, 경계는 얇은 선으로만. */

:root {
  --bg: #ffffff;
  --side: #f7f7f5;
  --text: #37352f;
  --muted: #787774;
  --faint: #9b9a97;
  --border: #e9e9e7;
  --hover: #efefed;
  --sel: #e8e7e4;
  --accent: #ff4655;
  --accent-soft: #fdf0f1;
  --code-bg: #f4f4f2;
  --code-fg: #c2445a;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --side: #202020;
    --text: #d4d4d4;
    --muted: #9b9a97;
    --faint: #7d7d78;
    --border: #2f2f2f;
    --hover: #2a2a2a;
    --sel: #333333;
    --accent: #ff6b78;
    --accent-soft: #2a1e20;
    --code-bg: #262626;
    --code-fg: #ef8a95;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── 레이아웃 ─────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--border);
  overflow-y: auto; overscroll-behavior: contain;
}
.content { flex: 1; min-width: 0; margin-left: 248px; }
.doc { max-width: 720px; margin: 0 auto; padding: 12px 40px 96px; }

/* ── 사이드바 ─────────────────────────────────────────────────────── */
.side-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 12px 10px; margin: 0 0 4px;
}
.side-head img {
  width: 26px; height: 26px; border-radius: 4px; object-fit: cover; flex: none;
}
.side-head .st { min-width: 0; line-height: 1.3; }
.side-head strong { display: block; font-size: 14px; font-weight: 600; }
.side-head span { display: block; font-size: 11.5px; color: var(--faint); }

.side-nav { padding: 0 8px 10px; }
.nav-label {
  padding: 14px 8px 4px; font-size: 11px; font-weight: 600;
  color: var(--faint); letter-spacing: .02em;
}
.side-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; margin-bottom: 1px; border-radius: 4px;
  font-size: 14px; color: var(--muted); text-decoration: none;
  transition: background-color .1s ease, color .1s ease;
}
.side-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-nav a.current { background: var(--sel); color: var(--text); font-weight: 600; }
.side-nav a .ni { width: 17px; text-align: center; font-size: 14px; flex: none; }
.side-nav a.sub {
  padding-left: 14px; font-size: 13.5px;
  border-left: 2px solid transparent; border-radius: 0 4px 4px 0; margin-left: 8px;
}
.side-nav a.sub.active { border-left-color: var(--accent); color: var(--text); font-weight: 600; }

.side-foot {
  margin-top: auto; padding: 12px; font-size: 11.5px; color: var(--faint);
  border-top: 1px solid var(--border);
}

/* ── 상단바 (모바일 메뉴 + 위치) ──────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 40px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px); -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid transparent;
}
.topbar.stuck { border-bottom-color: var(--border); }
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 500; }
.menu-btn {
  display: none; font: inherit; font-size: 17px; line-height: 1; cursor: pointer;
  width: 30px; height: 30px; border-radius: 4px;
  border: 0; background: transparent; color: var(--muted);
}
.menu-btn:hover { background: var(--hover); color: var(--text); }
.scrim {
  display: none; position: fixed; inset: 0; z-index: 25;
  background: rgba(15, 15, 15, .42);
}

/* ── 문서 제목 ────────────────────────────────────────────────────── */
.page-head { padding: 26px 0 8px; }
.page-icon { font-size: 44px; line-height: 1.1; margin-bottom: 8px; }
.page-head h1 {
  margin: 0 0 6px; font-size: 34px; line-height: 1.25;
  font-weight: 700; letter-spacing: -.02em;
}
.page-head .lede { margin: 0; color: var(--muted); font-size: 15px; }
.page-head .stamp { margin: 6px 0 0; color: var(--faint); font-size: 13px; }

hr.rule { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── 본문 요소 ────────────────────────────────────────────────────── */
h2 {
  margin: 34px 0 8px; font-size: 22px; font-weight: 650;
  letter-spacing: -.01em; scroll-margin-top: 64px;
}
h3 { margin: 24px 0 6px; font-size: 17px; font-weight: 650; scroll-margin-top: 64px; }
h4 { margin: 18px 0 4px; font-size: 15px; font-weight: 650; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 22px; }
li { margin-bottom: 4px; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
strong { font-weight: 650; }
.muted { color: var(--muted); }
small, .small { font-size: 13px; color: var(--muted); }

/* 명령어 이름은 한글이라 모노스페이스 폰트에 글리프가 없다. 그대로 두면
   브라우저 기본 한글 폰트로 제각각 대체돼 자간·굵기가 튄다. 모노스페이스
   뒤에 Pretendard 를 두면 라틴/기호만 모노스페이스로 잡히고 한글은 본문과
   같은 글꼴로 떨어진다(글꼴 대체는 글리프 단위로 일어난다). */
code {
  background: var(--code-bg); border-radius: 3px; padding: .5px 5px;
  font-size: 14px; color: var(--code-fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-variant-ligatures: none;
  word-break: keep-all;
}

/* ── 콜아웃 / 타일 ────────────────────────────────────────────────── */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--side); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin: 16px 0;
  font-size: 14px; color: var(--muted);
}
.callout .ci { font-size: 17px; line-height: 1.5; flex: none; }
.callout strong { color: var(--text); }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }
.callout.warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 10px; margin: 14px 0; }
.tile {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  background: var(--bg);
}
.tile h4 { margin: 0 0 4px; font-size: 14px; }
.tile p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ── 명령어 목록 ─────────────────────────────────────────────────── */
.cmdlist { list-style: none; padding: 0; margin: 12px 0; }
.cmdlist li { margin: 0; border-bottom: 1px solid var(--border); }
.cmdlist li:last-child { border-bottom: 0; }
.cmdlist .row {
  display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
  padding: 9px 6px; border-radius: 3px; transition: background-color .1s ease;
  color: inherit; text-decoration: none;
}
.cmdlist a.row:hover { background: var(--hover); }
.cmdlist a.row:hover .name code { color: var(--accent); }
.cmdlist .name { flex: none; min-width: 132px; font-weight: 600; line-height: 1.9; }
.cmdlist .desc { flex: 1; min-width: 190px; color: var(--muted); font-size: 14px; }
.need {
  flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px;
  border-radius: 3px; border: 1px solid var(--border); color: var(--faint);
}
.need.login { border-color: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--accent); }

/* ── 단계 ────────────────────────────────────────────────────────── */
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
ol.steps > li { counter-increment: s; position: relative; padding-left: 32px; margin-bottom: 14px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 2px;
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sel); color: var(--text); font-weight: 650; font-size: 12px;
}
ol.steps strong { display: block; margin-bottom: 1px; }
ol.steps p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── FAQ / 표 ────────────────────────────────────────────────────── */
details.faq { border-bottom: 1px solid var(--border); padding: 10px 2px; }
details.faq summary {
  cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before {
  content: "›"; color: var(--faint); font-size: 16px; width: 12px;
  transition: transform .12s ease;
}
details.faq[open] summary::before { transform: rotate(90deg); }
details.faq p { margin: 8px 0 4px 20px; color: var(--muted); font-size: 14px; }

table.opt { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
table.opt th, table.opt td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.opt th { color: var(--faint); font-weight: 600; font-size: 12.5px; }
table.opt tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

/* ── 버튼 ────────────────────────────────────────────────────────── */
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .1s ease, border-color .1s ease;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn .ico { width: 16px; height: 16px; flex: none; }

/* ── 카드 링크(문서 홈) ──────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; margin: 16px 0; }
.cards a {
  display: block; padding: 15px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: background-color .1s ease;
}
.cards a:hover { background: var(--hover); text-decoration: none; }
.cards .ci { font-size: 19px; line-height: 1.4; }
.cards b { display: block; font-size: 14.5px; font-weight: 600; margin: 3px 0 2px; }
.cards span { display: block; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ── 명령어 모아보기(showcase) ───────────────────────────────────── */
.cmd { border-bottom: 1px solid var(--border); padding: 22px 0; }
.cmd:last-child { border-bottom: 0; }
.cmd-head { display: flex; align-items: flex-start; gap: 11px; flex-wrap: wrap; margin-bottom: 12px; }
.cmd-badge { font-size: 21px; line-height: 1.3; flex: none; }
.cmd-head .meta { flex: 1; min-width: 190px; }
.cmd-head h3 { margin: 0 0 2px; font-size: 16px; }
.cmd-head h3 code {
  background: none; padding: 0; font-size: 16.5px; font-weight: 600;
  color: var(--text); letter-spacing: -.01em;
}
.cmd-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

.shot { margin: 0 0 10px; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--side);
}
.shot figcaption { padding: 5px 2px 0; font-size: 11.5px; color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: -.01em; }
.shot.empty img { display: none; }
.shot.empty::before {
  content: "GIF 를 넣어 주세요";
  display: grid; place-items: center; min-height: 168px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--side); color: var(--faint); font-size: 13px;
}
.cmd-opts { list-style: none; margin: 0; padding: 0; }
.cmd-opts li { font-size: 13.5px; color: var(--muted); padding-left: 13px; position: relative; margin-bottom: 3px; }
.cmd-opts li::before { content: "·"; position: absolute; left: 3px; color: var(--faint); }
.cmd-opts li:last-child { margin-bottom: 0; }
.cmd-opts .req { color: var(--accent); }

/* ── 하단 ────────────────────────────────────────────────────────── */
.disclaimer {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--faint);
}

/* ── 반응형 ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .16s ease; box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0); }
  body.nav-open .scrim { display: block; }
  .content { margin-left: 0; }
  .menu-btn { display: grid; place-items: center; }
  .topbar { padding: 0 18px; }
  .doc { padding: 12px 18px 80px; }
  .page-head h1 { font-size: 28px; }
}

@media print {
  .sidebar, .topbar, .scrim { display: none !important; }
  .content { margin-left: 0; }
  .doc { max-width: none; padding: 0; }
  .cmd { break-inside: avoid; }
  body { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
