/* ==================== 수금대장 이용약관 커스텀 스타일 ==================== */

html {
  scroll-behavior: smooth;
}

body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 상단 스크롤 시 헤더 그림자 */
#site-header.scrolled {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ---------- Chapter & Article ---------- */
.chapter {
  margin-top: 3.5rem;
  scroll-margin-top: 5.5rem;
}

.chapter:first-of-type {
  margin-top: 0;
}

.chapter-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #182a68;
  background: linear-gradient(90deg, #eef4ff 0%, rgba(238,244,255,0) 100%);
  border-left: 5px solid #3366ff;
  padding: 0.65rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1.75rem;
}

.article {
  margin-bottom: 2.25rem;
  scroll-margin-top: 5.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed #e2e8f0;
}

.chapter .article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #b9d1ff;
}

.article p {
  font-size: 0.975rem;
  line-height: 1.9;
  color: #334155;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.article p:last-child {
  margin-bottom: 0;
}

/* ---------- Lists ---------- */
.numbered-list {
  list-style: none;
  counter-reset: item;
  margin: 0.5rem 0 0.75rem 0.75rem;
  padding-left: 0;
}

.numbered-list li {
  counter-increment: item;
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 0.5rem;
}

.numbered-list li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #3366ff;
}

.bullet-list {
  list-style: none;
  margin: 0.5rem 0 0.75rem 0.75rem;
  padding-left: 0;
}

.bullet-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 0.4rem;
}

.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #8ab0ff;
  font-weight: 700;
}

/* ---------- TOC ---------- */
.toc-chapter-title {
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
}

.toc-chapter-title:hover {
  background-color: #eef4ff;
  color: #2148d9;
}

.toc-article-link {
  display: block;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  font-size: 0.825rem;
  color: #64748b;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.toc-article-link:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.toc-article-link.active {
  background-color: #eef4ff;
  color: #2148d9;
  font-weight: 600;
}

/* ---------- Back to top ---------- */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Mobile TOC ---------- */
#mobile-toc.open {
  transform: translateX(0);
}

/* ---------- Highlight on jump ---------- */
.article.highlight,
.chapter.highlight {
  animation: highlightPulse 1.6s ease;
}

@keyframes highlightPulse {
  0% { background-color: #fff7db; }
  100% { background-color: transparent; }
}

/* ---------- Print styles ---------- */
@media print {
  #site-header, #toc-sidebar, #mobile-toc, #mobile-toc-overlay,
  #back-to-top, #mobile-menu-btn {
    display: none !important;
  }
  main {
    padding: 0 !important;
  }
  body {
    background: #fff !important;
  }
  .article, .chapter {
    scroll-margin-top: 0 !important;
  }
}

/* ---------- Scrollbar (sidebar) ---------- */
#toc-sidebar::-webkit-scrollbar,
#mobile-toc::-webkit-scrollbar {
  width: 6px;
}
#toc-sidebar::-webkit-scrollbar-thumb,
#mobile-toc::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}
