/* =====================================================================
   사용자 가이드 인쇄 / PDF 양식 (A4)
   표지(이미지 띠) → 목차 → 장별 본문(새 쪽) → 뒤표지(소개 박스)
   ===================================================================== */
@page {
    size: A4;
    margin: 18mm 16mm 18mm;
    @bottom-left { content: "APSFlow 사용자 가이드"; font-size: 8pt; color: #8a94a3; }
    @bottom-right { content: counter(page); font-size: 8pt; color: #8a94a3; }
}
@page :first {
    margin: 0;
    @bottom-left { content: none; }
    @bottom-right { content: none; }
}

html, body { background: #fff; }
body { margin: 0; color: #2a2f36; font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* 화면에서 '인쇄용 보기'로 열었을 때: 종이처럼 보이게 */
@media screen {
    html, body { background: #e6eaf0; }
    .doc { width: 210mm; margin: 20px auto; background: #fff; box-shadow: 0 4px 24px rgba(0, 0, 0, .12); padding: 0 16mm 16mm; }
    .cover { margin: 0 -16mm; }
    .g-chapter { padding-top: 10mm; }
}

.doc-logo { font-size: 18pt; font-weight: 800; color: #fff; letter-spacing: .3px; }
.doc-logo span { color: #8fc0ff; }
.doc-logo.dark { color: #17345f; }
.doc-logo.dark span { color: #2f6fd0; }

/* ───── 표지 ───── */
.cover {
    position: relative; height: 297mm; box-sizing: border-box; overflow: hidden;
    display: flex; flex-direction: column; background: #fff;
    break-after: page;
}
.cover-top { display: flex; justify-content: space-between; align-items: center; padding: 18mm 16mm 0; }
.cover-top .doc-logo { color: #17345f; }
.cover-top .doc-logo span { color: #2f6fd0; }
.doc-kind { color: #8a94a3; font-size: 10pt; }
.cover-title { padding: 52mm 16mm 0; }
.cover-title h1 { margin: 0; font-size: 34pt; line-height: 1.25; color: #2a2f36; font-weight: 800; }
.cover-title p { margin: 8mm 0 0; font-size: 13pt; color: #4b5563; }
.cover-art { margin-top: auto; height: 108mm; }
.cover-art svg { display: block; width: 100%; height: 100%; }
.cover-bottom { display: flex; justify-content: flex-end; padding: 7mm 16mm 9mm; font-size: 9pt; color: #8a94a3; }

/* ───── 목차 ───── */
.toc-page { break-after: page; padding-top: 6mm; }
.toc-title { font-size: 20pt; letter-spacing: 2px; color: #17345f; margin: 0 0 10mm; padding-bottom: 4mm; border-bottom: 2px solid #2f6fd0; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { padding: 4mm 0; border-bottom: 1px solid #e3e7ec; font-size: 13pt; }
.toc a { color: #2a2f36; text-decoration: none; }
.toc-note { margin-top: 14mm; padding: 5mm 6mm; background: #f2f6fd; border-left: 3px solid #2f6fd0; font-size: 9.5pt; color: #4b5563; }

/* ───── 본문 (GuideContent 공유 스타일을 인쇄에 맞게 조정) ───── */
.guide { font-size: 10pt; line-height: 1.7; word-break: keep-all; overflow-wrap: break-word; } /* 한글은 낱말 단위로 줄바꿈 */
.g-chapter { break-before: page; margin: 0; }
.g-h2 { font-size: 17pt; margin-bottom: 6mm; }
.g-num { width: 9mm; height: 9mm; font-size: 12pt; }
.g-h3 { font-size: 12pt; margin: 6mm 0 3mm; break-after: avoid; }
.g-table { font-size: 8.8pt; }
.g-table tr, .g-fig, .g-callout, .g-flow li, .g-faq dt, .g-faq dd, .g-code { break-inside: avoid; }
.g-fig img { max-height: 105mm; width: auto; max-width: 100%; margin: 0 auto; }
.g-fig.small img { max-height: 95mm; }
.g-row2 { grid-template-columns: 1fr 1fr; }
.g-note, .g-callout, .g-flow li p, .g-faq dd { font-size: 9pt; }
.g-code { white-space: pre-wrap; font-size: 9pt; }

/* ───── 뒤표지 ───── */
@page back {
    @bottom-left { content: none; }
    @bottom-right { content: none; }
}
.back { page: back; break-before: page; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240mm; }
.back-box { padding: 9mm 10mm; background: #f2f4f7; border-radius: 3mm; }
.back-box p { margin: 4mm 0 0; font-size: 9.5pt; line-height: 1.65; color: #4b5563; }
.copyright { margin: 6mm 0 0; font-size: 8pt; color: #8a94a3; }
