@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --blue: #8A54FF; --blue-light: #F0EBFF; --blue-mid: #D5C2FF; --blue-dark: #6B38D4;
  --navy: #2E195C;
  --green: #00c471; --green-light: #e8faf2;
  --orange: #f59e0b; --orange-light: #fef6e4;
  --red: #f04452; --red-light: #fff1f2;
  --purple: #9B6DFF; --purple-light: #f0ebff;
  --g50: #f9fafb; --g100: #f2f4f6; --g200: #e5e8eb;
  --g300: #d1d6db; --g400: #b0b8c1; --g500: #8b95a1;
  --g600: #6b7684; --g700: #4e5968; --g800: #333d4b; --g900: #191f28;
  --white: #ffffff;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--white); color: var(--g900);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: break-word;
}

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--g100);
}
.header-inner {
  max-width: 720px; margin: 0 auto; padding: 0 28px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--g700);
  text-decoration: none; padding: 7px 12px 7px 8px;
  border-radius: 9px; transition: background 0.12s, color 0.12s;
}
.back-link:hover { background: var(--g100); color: var(--g900); }
.header-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none; padding: 7px 14px; border-radius: 9px;
  transition: background 0.12s;
}
.header-link:hover { background: var(--blue-light); }

/* ── Layout ── */
.main { max-width: 720px; margin: 0 auto; padding: 0 28px 100px; }

/* ── Article Header ── */
.article-header {
  padding: 52px 0 36px;
  animation: fade-in-up 0.35s cubic-bezier(0.4,0,0.2,1) both;
}
.article-icon { display: block; font-size: 48px; margin-bottom: 20px; line-height: 1; }
.article-header h1 {
  font-size: 34px; font-weight: 800; line-height: 1.3;
  letter-spacing: -0.6px; color: var(--g900); margin-bottom: 14px;
}
.article-meta { font-size: 13px; color: var(--g500); line-height: 1.5; }

/* ── TOC ── */
.toc {
  border: 1.5px solid var(--g200); border-radius: 14px;
  padding: 22px 26px 20px; margin-bottom: 36px;
  background: var(--white);
  animation: fade-in-up 0.35s cubic-bezier(0.4,0,0.2,1) 0.06s both;
}
.toc-title {
  font-size: 11px; font-weight: 700; color: var(--g400);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px;
}
.toc ol { list-style: none; padding: 0; counter-reset: toc-counter; display: flex; flex-direction: column; gap: 2px; }
.toc li { counter-increment: toc-counter; display: flex; align-items: baseline; gap: 8px; }
.toc li::before {
  content: counter(toc-counter);
  min-width: 20px; height: 20px; border-radius: 6px;
  background: var(--blue-light); color: var(--blue-dark);
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative; top: -1px;
}
.toc a {
  display: block; padding: 6px 0;
  font-size: 14px; font-weight: 500; color: var(--g700);
  text-decoration: none; transition: color 0.12s;
}
.toc a:hover { color: var(--blue); }

/* ── Article Body ── */
.article-body {
  background: var(--white); border-radius: 0; padding: 0;
  animation: fade-in-up 0.35s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}

/* ── Headings ── */
.article-body h2 {
  font-size: 28px; font-weight: 800; color: var(--g900);
  letter-spacing: -0.5px; line-height: 1.35;
  margin: 64px 0 20px; padding-bottom: 16px;
  border-bottom: 1.5px solid var(--g100);
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-size: 22px; font-weight: 800; color: var(--g900);
  letter-spacing: -0.4px; line-height: 1.4;
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--g100);
}

.article-body h4 {
  font-size: 15px; font-weight: 700; color: var(--g700);
  margin: 24px 0 8px;
}

/* ── Body Text ── */
.article-body p {
  font-size: 17px; line-height: 1.85; color: var(--g800);
  margin-bottom: 20px;
}

.article-body > p:first-child,
.article-body .intro {
  font-size: 17px; color: var(--g600); line-height: 1.85;
  margin-bottom: 36px; padding: 24px 28px;
  background: var(--g50); border-radius: 14px;
  border: 1.5px solid var(--g100);
}

/* ── Lists ── */
.article-body ul, .article-body ol { padding-left: 0; margin-bottom: 20px; list-style: none; }

.article-body ul > li {
  font-size: 17px; line-height: 1.75; color: var(--g800);
  padding: 4px 0 4px 22px; position: relative; margin-bottom: 4px;
}
.article-body ul > li::before {
  content: ''; position: absolute; left: 5px; top: 13px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--g400);
}

.article-body ol { counter-reset: list-counter; }
.article-body ol > li {
  counter-increment: list-counter;
  font-size: 17px; line-height: 1.75; color: var(--g800);
  padding: 5px 0 5px 32px; position: relative; margin-bottom: 6px;
}
.article-body ol > li::before {
  content: counter(list-counter);
  position: absolute; left: 0; top: 1px;
  color: var(--blue); font-size: 16px; font-weight: 800;
}

.article-body li > ul, .article-body li > ol {
  margin-top: 8px; margin-bottom: 2px;
  padding-left: 8px;
}
.article-body li > ul > li, .article-body li > ol > li {
  font-size: 16px; color: var(--g800); margin-bottom: 4px;
}
.article-body li ul > li::before { background: var(--g300); width: 4px; height: 4px; top: 11px; }
.article-body li ol > li::before { background: none; width: auto; height: auto; }

/* 리스트 안 레이블 + 설명 분리 */
.article-body li > strong.label {
  display: block; margin-bottom: 6px;
  font-size: 16.5px; font-weight: 800; color: var(--g900);
  letter-spacing: -0.3px;
}

/* ── Links ── */
.article-body a {
  color: var(--blue); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(138,84,255,0.28);
  transition: border-color 0.12s; word-break: break-all;
}
.article-body a:hover { border-bottom-color: var(--blue); }

/* ── Divider ── */
.article-body hr { border: none; border-top: 1.5px solid var(--g100); margin: 52px 0; }

/* ── Table ── */
.article-body table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 16px 0 28px; font-size: 15px;
  border-radius: 12px; overflow: hidden; border: 1.5px solid var(--g200);
}
.article-body th {
  padding: 13px 18px; text-align: left; background: var(--g50);
  font-weight: 700; font-size: 13px; color: var(--g600);
  border-bottom: 1.5px solid var(--g200);
}
.article-body td {
  padding: 13px 18px; text-align: left;
  border-bottom: 1px solid var(--g100); color: var(--g800); line-height: 1.6;
}
.article-body tr:last-child td { border-bottom: none; }
.article-body tbody tr:hover td { background: rgba(138,84,255,0.025); }

/* ── Code ── */
.article-body code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  background: var(--g100); padding: 3px 8px; border-radius: 6px;
  font-size: 15px; color: var(--purple); border: 1px solid var(--g200);
  font-weight: 500;
}
/* Copy button wrapper */
.code-block {
  position: relative;
}
.article-body .code-block pre {
  padding-top: 48px;
  white-space: pre-wrap; word-break: break-all;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  padding: 6px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  font-family: 'Pretendard', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; z-index: 1;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.copy-btn.copied { background: var(--green); color: var(--white); border-color: var(--green); }

/* 양식 복사 버튼 */
.copy-btn-form {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 10px;
  background: var(--white); color: var(--blue);
  border: 1.5px solid var(--blue);
  font-family: 'Pretendard', sans-serif;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; margin-bottom: 16px;
}
.copy-btn-form:hover { background: var(--blue-light); }
.copy-btn-form.copied { background: var(--green); color: var(--white); border-color: var(--green); }

/* 테이블 내 복사 아이콘 */
.table-wrap {
  position: relative;
}
.table-copy-btn {
  position: absolute; top: -18px; right: 0; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 8px;
  background: var(--white); border: 1.5px solid var(--g200);
  font-size: 13px; font-weight: 600; color: var(--g600);
  font-family: 'Pretendard', sans-serif;
  cursor: pointer; transition: all 0.15s;
}
.table-copy-btn::after { content: '복사'; }
.table-copy-btn:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.table-copy-btn.copied { background: var(--green-light); border-color: var(--green); color: var(--green); }
.table-copy-btn.copied::after { content: '복사됨!'; }

/* 가이드 이미지 */
.article-body img {
  max-width: 480px; max-height: 320px;
  width: auto; height: auto;
  border-radius: 12px; border: 1.5px solid var(--g200);
  margin: 16px 0 24px; display: block;
  box-shadow: var(--shadow-sm);
  object-fit: contain;
  cursor: zoom-in; transition: opacity 0.15s;
}
.article-body img:hover { opacity: 0.9; }

/* 이미지 모달 */
.img-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  cursor: zoom-out; padding: 32px;
  animation: modal-in 0.2s ease;
}
.img-modal.active { display: flex; }
.img-modal img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 16px; border: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  object-fit: contain; cursor: zoom-out;
  margin: 0;
}
.img-modal-close {
  position: absolute; top: 20px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none;
  color: white; font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.img-modal-close:hover { background: rgba(255,255,255,0.3); }
@keyframes modal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.step-card img { max-width: 100%; }
.article-body li { overflow: hidden; }

/* ghost 복사 버튼 (테이블 하단) */
.ghost-copy-btn {
  background: none; border: none;
  font-family: 'Pretendard', sans-serif;
  font-size: 13px; font-weight: 600; color: var(--g500);
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: all 0.15s;
}
.ghost-copy-btn:hover { color: var(--blue); background: var(--blue-light); }
.ghost-copy-btn.copied { color: var(--green); }

.article-body pre {
  background: #16202e; color: #cdd6f4; padding: 24px 28px;
  border-radius: 14px; overflow-x: auto; margin: 20px 0 28px;
  font-size: 13.5px; line-height: 1.75; box-shadow: var(--shadow-md);
}
/* UI 요소 (버튼, 메뉴명) */
.article-body kbd {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--g100); color: var(--g800);
  font-family: 'Pretendard', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0;
  border: 1.5px solid var(--g200);
  vertical-align: baseline; line-height: 1.4;
}

.article-body pre code {
  background: none; padding: 0; color: inherit; font-size: inherit;
  border: none; font-weight: 400;
}

/* ── Callouts (토스: 배경만으로 구분, 왼쪽 선 없음) ── */
.callout {
  padding: 18px 20px; border-radius: 12px; margin: 8px 0 24px;
  font-size: 16px; line-height: 1.75; border: 1.5px solid transparent;
}
.callout p { margin-bottom: 6px; font-size: 16px; line-height: 1.75; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { font-weight: 700; }
.callout code { font-size: 12px; }

.callout-blue { background: var(--blue-light); border-color: rgba(138,84,255,0.18); color: #1a3a6b; }
.callout-blue strong { color: var(--blue-dark); }
.callout-blue code { background: rgba(138,84,255,0.12); color: var(--blue-dark); border-color: rgba(138,84,255,0.2); }
.callout-green { background: var(--green-light); border-color: rgba(0,196,113,0.2); color: #014d2c; }
.callout-green strong { color: #005f38; }
.callout-orange { background: var(--orange-light); border-color: rgba(245,158,11,0.2); color: #6b3a00; }
.callout-orange strong { color: #7c4300; }
.callout-red { background: var(--red-light); border-color: rgba(240,68,82,0.2); color: #8b0c18; }
.callout-red strong { color: #a01020; }
.callout-gray { background: var(--g50); border-color: var(--g200); color: var(--g700); }
.callout-gray strong { color: var(--g800); }

/* ── Blockquote ── */
.article-body blockquote {
  padding: 20px 24px; background: var(--blue-light);
  border-radius: 12px; border-left: 4px solid var(--blue); margin: 16px 0 24px;
}
.article-body blockquote p { margin-bottom: 0; color: var(--g800); font-size: 15px; line-height: 1.75; }

/* ── Step Timeline ── */
.step-card {
  background: transparent; border-radius: 0;
  padding: 0 0 32px 52px; margin: 0;
  border: none; box-shadow: none;
  position: relative;
}
.step-card + .step-card { margin-top: 0; }

/* 세로 연결선 */
.step-card::before {
  content: ''; position: absolute;
  left: 13px; top: 36px; bottom: 0;
  width: 1.5px; background: var(--g200);
}
.step-card:last-of-type::before { display: none; }

.step-card:hover { border-color: transparent; box-shadow: none; }

.step-card h3 {
  border-left: none; padding-left: 0;
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--g900);
  position: relative;
}
.step-num {
  position: absolute; left: -52px; top: -1px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 0 0 4px var(--blue-light);
  z-index: 1;
}
.step-card p { font-size: 16px; color: var(--g700); }
.step-card li { font-size: 16px; color: var(--g700); }

/* 모바일 */
@media (max-width: 640px) {
  .step-card { padding: 0 0 28px 44px; }
  .step-card::before { left: 11px; }
  .step-num { left: -44px; width: 24px; height: 24px; font-size: 11px; box-shadow: 0 0 0 3px var(--blue-light); }
}

/* ── FAQ / Details ── */
.faq, .article-body details {
  background: var(--white); border-radius: 12px; padding: 0;
  margin: 8px 0; border: 1.5px solid var(--g200);
  overflow: hidden; transition: border-color 0.15s;
}
.faq:hover, .article-body details:hover { border-color: var(--g300); }
.article-body details[open], .faq[open] { border-color: rgba(138,84,255,0.35); }

.faq summary, .article-body summary {
  font-weight: 700; font-size: 15px; cursor: pointer; line-height: 1.55;
  color: var(--g800); padding: 18px 22px;
  list-style: none; display: flex; align-items: center; gap: 10px;
  transition: color 0.12s;
}
.faq summary::-webkit-details-marker, .article-body summary::-webkit-details-marker { display: none; }
.faq summary::after, .article-body summary::after {
  content: '›'; margin-left: auto; font-size: 20px; color: var(--g400);
  transition: transform 0.2s; font-weight: 400;
}
.article-body details[open] summary::after, .faq[open] summary::after {
  transform: rotate(90deg); color: var(--blue);
}

.faq p, .article-body details > p {
  padding: 0 22px 18px; margin: 0; font-size: 15px; line-height: 1.75;
  color: var(--g700); border-top: 1px solid var(--g100); padding-top: 16px;
}

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-green { background: var(--green-light); color: #005f38; }
.badge-red { background: var(--red-light); color: #a01020; }
.badge-orange { background: var(--orange-light); color: #7c4300; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 26px; background: var(--blue); color: var(--white);
  border-radius: 12px; text-decoration: none; font-size: 15px; font-weight: 700;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  margin: 10px 4px 10px 0; box-shadow: 0 2px 8px rgba(138,84,255,0.3);
  border-bottom: none;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(138,84,255,0.38); border-bottom: none; }
.btn-primary:active { transform: scale(0.98); }
.article-body .btn-primary { color: var(--white); border-bottom: none; }
.article-body .btn-primary:hover { color: var(--white); border-bottom: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 24px; background: var(--white); color: var(--blue);
  border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 700;
  transition: background 0.15s, transform 0.15s;
  margin: 10px 4px 10px 0;
  border: 1.5px solid var(--blue); border-bottom: 1.5px solid var(--blue);
}
.btn-secondary:hover { background: var(--blue-light); transform: translateY(-1px); border-bottom: 1.5px solid var(--blue); }
.article-body .btn-secondary { color: var(--blue); border-bottom: 1.5px solid var(--blue); }
.article-body .btn-secondary:hover { color: var(--blue); border-bottom: 1.5px solid var(--blue); }

/* ── Help Banner ── */
.bottom-help {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 26px; border-radius: 16px;
  background: var(--g50); border: 1.5px solid var(--g200);
  margin-top: 48px; text-decoration: none; color: var(--g900);
  transition: border-color 0.15s, background 0.15s;
}
.bottom-help:hover { border-color: var(--g300); background: var(--g100); }
.bottom-help-icon { font-size: 28px; flex-shrink: 0; }
.bottom-help-body { flex: 1; }
.bottom-help-body strong { display: block; font-size: 15px; font-weight: 700; color: var(--g900); margin-bottom: 3px; }
.bottom-help-body span { font-size: 13px; color: var(--g500); line-height: 1.5; }

/* ── Section Divider ── */
.section-break { height: 1px; background: var(--g100); margin: 52px 0; border: none; }

/* ── Footer ── */
.footer { text-align: center; padding: 36px 0 20px; font-size: 12px; color: var(--g400); }

/* ── Animation ── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .main { padding: 0 20px 72px; }
  .header-inner { padding: 0 20px; }
  .article-header { padding: 40px 0 28px; }
  .article-header h1 { font-size: 24px; }
  .article-icon { font-size: 40px; margin-bottom: 16px; }
  .toc { padding: 18px 20px 16px; margin-bottom: 28px; }
  .toc a { padding: 5px 0; }
  .article-body h2 { font-size: 18px; margin: 48px 0 16px; }
  .article-body h3 { font-size: 15px; margin: 28px 0 10px; }
  .article-body p { font-size: 15px; line-height: 1.8; }
  .article-body ul > li, .article-body ol > li { font-size: 15px; }
  .article-body table { font-size: 13px; }
  .article-body th, .article-body td { padding: 10px 13px; }
  .step-card { padding: 20px 20px; }
  .callout { padding: 15px 17px; }
  .bottom-help { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 400px) {
  .main { padding: 0 16px 64px; }
  .article-header h1 { font-size: 22px; }
}
