:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --line: #e4e7ec;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #03c75a;
  --radius: 10px;
  --mono: D2Coding, Consolas, Monaco, "Courier New", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "맑은 고딕", "Malgun Gothic", "Nanum Gothic", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 16px; color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
}
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  padding: 7px 12px; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
}
.site-nav a:hover { background: #f1f3f7; color: var(--text); }
.site-nav a[aria-current="page"] { background: #eaf0ff; color: var(--brand-dark); font-weight: 700; }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: 7px;
  font-size: 17px; padding: 5px 10px; cursor: pointer;
}

/* ── 히어로 ── */
.hero { padding: 40px 0 24px; text-align: center; }
.hero h1 { font-size: 32px; line-height: 1.35; margin: 0 0 12px; letter-spacing: -0.03em; }
.hero p { font-size: 16.5px; color: var(--muted); margin: 0 auto; max-width: 680px; word-break: keep-all; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.badge {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}

/* ── 광고 ── */
.ad-slot { margin: 26px auto; min-height: 90px; max-width: 970px; overflow: hidden; }
.ad-placeholder {
  display: grid; place-items: center;
  border: 1px dashed #cfd4dc; border-radius: var(--radius);
  color: #9aa1ad; font-size: 13px; background: #fafbfc;
}

/* ── 도구 ── */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbfcfd;
}

.seg { display: inline-flex; background: #eef1f5; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 6px 13px; border-radius: 7px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  font-family: inherit;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

.platform-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.platform-tab {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted); font-family: inherit;
}
.platform-tab:hover { border-color: #c9d2e0; }
.platform-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.hint {
  margin: 0; padding: 11px 16px;
  background: #f0f6ff; border-bottom: 1px solid var(--line);
  font-size: 13.5px; color: #37517e; word-break: keep-all;
}
.hint code { background: rgba(255, 255, 255, .7); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }

.opts { display: flex; flex-wrap: wrap; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #475467; }
.opts input { accent-color: var(--brand); width: 15px; height: 15px; }

.panes { display: grid; grid-template-columns: 1fr 1fr; min-height: 520px; }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-left: 1px solid var(--line); }
.pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--muted); background: #fbfcfd;
}
.pane-head .seg { margin-left: auto; }
.pane-head .seg button { padding: 4px 11px; font-size: 13px; }

textarea, .out-area {
  flex: 1; width: 100%; border: 0; resize: none; outline: none;
  padding: 18px; font-family: var(--mono); font-size: 14px; line-height: 1.75;
  color: var(--text); background: #fff;
}
textarea.dropping { background: #eef6ff; }
#preview { flex: 1; width: 100%; border: 0; background: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fbfcfd; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 9px 15px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
}
.btn:hover { background: #f4f6f9; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: none; color: var(--muted); }
.btn-file { display: inline-flex; align-items: center; }
.btn-file input { display: none; }
.spacer { flex: 1; }
.stats { font-size: 12.5px; color: var(--muted); align-self: center; }

/* ── 토스트 ── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #111827; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: .22s; z-index: 100; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #b42318; }

/* ── 콘텐츠 섹션 ── */
.section { margin: 56px 0; }
.section > h2 { font-size: 25px; letter-spacing: -0.02em; margin: 0 0 8px; }
.section > .lead { color: var(--muted); margin: 0 0 24px; word-break: keep-all; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit; display: block;
}
.card:hover { border-color: #c7d2e5; box-shadow: 0 4px 16px rgba(16, 24, 40, .06); }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; word-break: keep-all; }
.card .step { display: inline-block; font-size: 12px; font-weight: 800; color: var(--brand); margin-bottom: 6px; }

.faq { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15.5px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q. "; color: var(--brand); font-weight: 800; }
.faq details[open] summary { background: #fbfcfd; }
.faq .answer { padding: 0 20px 18px; color: #475467; font-size: 15px; word-break: keep-all; }
.faq .answer p { margin: 0 0 10px; }

/* ── 문서 페이지 ── */
.article { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 44px 48px; margin: 32px 0; }
.article h1 { font-size: 30px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -0.03em; }
.article .meta { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.article h2 { font-size: 22px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); letter-spacing: -0.02em; }
.article h3 { font-size: 18px; margin: 28px 0 10px; }
.article p, .article li { font-size: 16px; color: #374151; word-break: keep-all; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: 7px; }
.article table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; }
.article th, .article td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article th { background: #f8fafc; font-weight: 700; }
.article code { background: #f1f3f7; color: #c2255c; padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 14px; }
.article pre { background: #1e2430; color: #dbe2ef; padding: 16px 18px; border-radius: 8px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; }
.article pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.article blockquote { margin: 18px 0; padding: 12px 18px; background: #f7f9fc; border-left: 4px solid var(--brand); border-radius: 0 8px 8px 0; color: #475467; }
.article .callout { margin: 20px 0; padding: 16px 18px; background: #fff8e6; border: 1px solid #f3dfa8; border-radius: 8px; font-size: 15px; color: #6b5417; }
.article img { max-width: 100%; height: auto; border-radius: 8px; }

.toc-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; margin: 0 0 30px; }
.toc-box strong { display: block; font-size: 14px; margin-bottom: 8px; }
.toc-box ul { margin: 0; padding-left: 18px; }
.toc-box li { font-size: 14.5px; margin-bottom: 3px; }

.cta {
  display: block; margin: 34px 0 0; padding: 20px 24px;
  background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff;
  border-radius: 12px; text-decoration: none;
}
.cta strong { display: block; font-size: 17px; margin-bottom: 4px; }
.cta span { font-size: 14.5px; opacity: .88; }

/* ── 푸터 ── */
.site-footer { margin-top: 70px; padding: 44px 0 30px; background: #fff; border-top: 1px solid var(--line); }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-cols strong { display: block; margin-bottom: 10px; font-size: 14.5px; }
.footer-cols p { margin: 0; color: var(--muted); font-size: 14px; word-break: keep-all; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 6px; }
.footer-cols a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-cols a:hover { color: var(--brand); text-decoration: underline; }
.copy { margin: 34px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: #98a2b3; font-size: 13px; text-align: center; }

@media (max-width: 860px) {
  .panes { grid-template-columns: 1fr; }
  .pane + .pane { border-left: 0; border-top: 1px solid var(--line); }
  .pane { min-height: 340px; }
  .site-nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 8px;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 25px; }
  .article { padding: 28px 20px; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
}
