/* =====================================================================
   회로 자료실 — 전체 디자인
   [16단계] 모눈종이 배경을 없애고, 흰 바탕의 차분한 문서 사이트 느낌으로 정리했습니다.

   구성
     1. 색·글꼴 기본값
     2. 공통 요소 (버튼, 태그, 알림, 입력칸)
     3. 머리말과 메뉴
     4. 첫 화면
     5. 게시판 목록 / 상세 / 댓글
     6. 자료실 (목차 + 본문)
     7. 폼, 에러 화면, 내 활동
     8. 휴대폰 화면
   ===================================================================== */

/* =========================================================
   1. 색·글꼴 기본값
   :root 에 모아 두면 색을 한 곳에서 바꿀 수 있습니다.
   ========================================================= */
:root {
  --bg: #f1f4f7;          /* 페이지 배경 (아주 연한 회색) — 흰 본문과 구분해 주는 역할 */
  --surface: #ffffff;     /* 카드 배경 */
  --surface-2: #f7f8fa;   /* 표 머리글처럼 살짝 구분할 때 */
  --shadow: 0 1px 2px rgba(22, 32, 44, 0.05);   /* 카드를 배경에서 살짝 띄우는 그림자 */
  --ink: #16202c;         /* 본문 글자 */
  --muted: #68758a;       /* 보조 글자 (날짜, 설명) */
  --line: #e6e9ef;        /* 얇은 구분선 */
  --line-strong: #cfd6e0; /* 조금 진한 선 */
  --accent: #0f7a4d;      /* 포인트 색 (기판 녹색) */
  --accent-soft: #e9f5ef; /* 포인트 색의 아주 연한 버전 */
  --danger: #b42318;      /* 삭제, 경고 */
  --radius: 8px;          /* 모서리 둥글기 */
}

/* 색이 마음에 들지 않으면 :root 의 값만 바꾸면 사이트 전체가 바뀝니다.
     --accent  차분한 남색 #1d4ed8 · 깊은 청록 #0f766e · 진한 보라 #6d28d9 · 벽돌색 #b4530f
     --bg      더 밝게 #f6f8fa · 더 진하게 #e9edf2 · 완전한 흰색 #ffffff

   화면 구성 방식
     연한 회색 배경 위에 흰색 "카드"를 올려서 본문 영역을 구분합니다.
     (위키독스도 같은 방식입니다) */

/* 본문을 담는 흰색 카드. 여러 곳에서 같은 모양을 쓰므로 한 번에 정의합니다. */
.panel,
.hero, .form, .error-page, .post, .post-table, .comments,
.recent-list, .activity-list, .book-cover, .book-toc-box,
.doc-sidebar, .doc-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.35; letter-spacing: -0.01em; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.inline { display: inline; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* 키보드로 이동할 때 보이는 테두리 (접근성) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =========================================================
   2. 공통 요소
   ========================================================= */
/* ----- 버튼 ----- */
.btn {
  display: inline-block; padding: 7px 16px;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: var(--radius);
  font: inherit; font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.btn:hover { background: #0c6540; border-color: #0c6540; }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 400; }
.btn-light:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #99271e; border-color: #99271e; }

/* 글자처럼 보이는 버튼 (댓글 삭제, 로그아웃) */
.link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 0.88rem; color: var(--muted);
  cursor: pointer; text-decoration: underline;
}
.link-btn:hover { color: var(--ink); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ----- 태그 ----- */
.tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600; line-height: 1.6;
  padding: 1px 9px; border-radius: 20px; white-space: nowrap;
  border: 1px solid currentColor; text-decoration: none;
}
.tag-board { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.tag-board:hover { background: #dcecE3; }
.tag-notice { color: #fff; background: var(--danger); border-color: var(--danger); }

/* ----- 알림 메시지 ----- */
.notice {
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid #cfe6da; border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 16px; font-size: 0.93rem;
}
.notice.error { background: #fdf2f1; border-color: #f3d4d1; border-left-color: var(--danger); }
.error { color: var(--danger); margin: 4px 0; font-size: 0.88rem; }

/* ----- 입력칸 ----- */
input, select, textarea {
  font: inherit; font-size: 0.95rem; width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: #9aa5b5; }
textarea { line-height: 1.7; }

/* =========================================================
   3. 머리말과 메뉴
   ========================================================= */
/* 머리말과 메뉴를 하나의 흰 띠로 묶고, 아래에 선을 그어 본문과 구분합니다 */
.site-header { background: var(--surface); }
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 62px; gap: 12px; flex-wrap: wrap;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em;
}
/* 로고의 파형은 SVG 안에서 currentColor 를 쓰므로, 여기서 색을 정합니다 */
.logo svg { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 14px; font-size: 0.92rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a.btn { color: #fff; }

/* ----- 메뉴 탭 ----- */
.board-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  margin-bottom: 26px; overflow-x: auto;
}
.board-nav-inner { display: flex; gap: 4px; white-space: nowrap; }
.board-nav a {
  padding: 11px 14px; color: var(--muted); text-decoration: none;
  font-size: 0.94rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.board-nav a:hover { color: var(--ink); }
.board-nav a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* =========================================================
   4. 첫 화면
   ========================================================= */
.hero { padding: 26px 28px 28px; margin-bottom: 30px; }
.hero h1 { margin: 0 0 6px; font-size: 1.75rem; }
.hero p { margin: 0 0 18px; }
.hero-search { display: flex; gap: 8px; max-width: 540px; }
.hero-search input { flex: 1; min-width: 0; }

.home-section { margin-bottom: 36px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.02rem; margin: 0; letter-spacing: -0.01em; }
.section-head a { text-decoration: none; }

/* 책 카드 */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.book-card {
  display: block; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: border-color 0.15s, transform 0.15s;
}
.book-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.book-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.book-card p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.book-meta { margin-top: 12px !important; font-size: 0.8rem !important; }

/* 최근 글 목록 / 검색 결과 */
.recent-list { list-style: none; margin: 0; padding: 4px 18px; }
.recent-list li {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { color: var(--ink); text-decoration: none; }
.recent-list a:hover { text-decoration: underline; }
.recent-list .muted { margin-left: auto; font-size: 0.82rem; }
.search-results li { display: block; }
.search-results p { margin: 4px 0 0; font-size: 0.87rem; }

/* =========================================================
   5. 게시판
   ========================================================= */
.board-head { margin-bottom: 18px; }
.board-head h1 { font-size: 1.4rem; margin: 0; }
.board-head p { margin: 4px 0 0; }

.toolbar { margin-bottom: 14px; }
/* [18단계 추가] 글쓰기 버튼은 검색창 위 오른쪽에 */
.toolbar-top { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }

/* ----- 글 목록 표: 테두리 없이 가로줄만 ----- */
/* border-collapse 를 separate 로 둬야 카드처럼 모서리를 둥글게 깎을 수 있습니다 */
.post-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.post-table th {
  padding: 11px 10px; text-align: left; background: var(--surface-2);
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}
.post-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.post-table tbody tr:hover { background: var(--surface-2); }
.post-table td a { color: var(--ink); text-decoration: none; font-weight: 500; }
.post-table td a:hover { text-decoration: underline; }
/* 표의 양 끝에 여백을 줘서 카드 안쪽처럼 보이게 */
.post-table th:first-child, .post-table td:first-child { padding-left: 18px; }
.post-table th:last-child, .post-table td:last-child { padding-right: 18px; }
.post-table tr:last-child td { border-bottom: 0; }
.col-cat { width: 92px; }
.col-author { width: 110px; color: var(--muted); font-size: 0.88rem; }
.col-num, .col-date { width: 62px; text-align: center !important; color: var(--muted); font-size: 0.85rem; }
.count { color: var(--accent); font-size: 0.82rem; font-weight: 600; margin-left: 5px; }
.notice-row { background: #fcfcfd; }
.post-table .empty { padding: 56px 16px !important; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 28px 0; font-size: 0.92rem; }
.pagination a { text-decoration: none; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); }
.pagination a:hover { background: var(--surface-2); }

/* ----- 글 상세 ----- */
.post { padding: 26px 30px 24px; }
.post > p:first-child { margin: 0 0 8px; }
.post h1 { font-size: 1.55rem; margin: 0 0 10px; }
.post h1 + .muted { margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.post .actions { justify-content: flex-end; margin-top: 20px; }
.post .actions .btn { padding: 5px 14px; font-size: 0.86rem; font-weight: 400; background: #fff; color: var(--ink); border-color: var(--line-strong); }
.post .actions .btn:hover { background: var(--surface-2); }
.post .actions .btn-danger { color: var(--danger); }

/* 본문 (에디터로 쓴 내용) */
.post-body { padding: 24px 0 8px; min-height: 140px; word-break: break-word; }
.post-body img { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.post-body figure { margin: 20px 0; }
.post-body figure.image_resized img { width: 100%; }
.post-body figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 8px; }
.post-body figure.table { overflow-x: auto; }
.post-body table { border-collapse: collapse; min-width: 50%; font-size: 0.93rem; }   /* 본문 안의 표는 그대로 */
.post-body th, .post-body td { border: 1px solid var(--line); padding: 7px 12px; }
.post-body th { background: var(--surface-2); }
.post-body pre {
  background: #111a24; color: #e6edf3;
  padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; font-size: 0.88rem;
}
.post-body pre code { font-family: Consolas, "D2Coding", ui-monospace, monospace; }
.post-body blockquote {
  border-left: 3px solid var(--accent); background: var(--surface-2);
  margin: 16px 0; padding: 10px 16px; color: #46536a; border-radius: 0 6px 6px 0;
}
.post-body a { text-decoration: underline; }

/* ----- 추천 버튼 ----- */
.like-box { text-align: center; margin: 32px 0 8px; }
.like-box form { display: inline; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 24px; font: inherit; font-size: 0.93rem; cursor: pointer;
  background: #fff; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 24px;
}
.like-btn:hover { background: var(--accent-soft); }
.like-btn.liked { background: var(--accent); color: #fff; }
.like-btn.disabled { cursor: default; color: var(--muted); border-color: var(--line-strong); }
.like-btn.disabled:hover { background: #fff; }
.like-box .muted { margin: 8px 0 0; }

/* ----- 댓글 ----- */
.comments { padding: 20px 24px; margin-top: 22px; }
.comments h2 + .comment { border-top: 1px solid var(--line); }
.comments h2 { font-size: 0.95rem; margin: 0 0 6px; }
.comment { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: 0; }
.comment > p.muted { font-size: 0.82rem; margin: 0 0 4px; }
.comment > div { line-height: 1.7; word-break: break-word; }
.comment form.inline { position: absolute; top: 12px; right: 0; }
.comment:target { background: #fffbeb; border-radius: 6px; padding-left: 10px; padding-right: 10px; }

.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; }
.comment-form textarea { resize: vertical; min-height: 62px; background: var(--surface-2); }
.comment-form textarea:focus { background: #fff; }

.comments + p { margin: 24px 0 32px; }
.comments + p a {
  display: inline-block; padding: 7px 18px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: 0.92rem;
}
.comments + p a:hover { background: var(--surface-2); }

/* =========================================================
   6. 자료실 (목차 + 본문)
   ========================================================= */
/* ----- 책 표지 ----- */
.book-cover { padding: 28px 30px 26px; }
.book-cover h1 { font-size: 1.7rem; margin: 0 0 8px; }
.book-cover .actions { margin-top: 24px; }
.book-desc { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.book-toc-box { margin-top: 22px; padding: 18px 20px; }
.book-toc-box h2 { font-size: 0.95rem; margin: 0 0 10px; color: var(--muted); }

/* ----- 목차 -----
   회로 기판의 배선과 패드를 떠올리게 하는 선과 점으로 표시했습니다.
   (이 사이트에서 가장 특징적인 부분이라 여기에만 장식을 넣었습니다) */
.toc, .toc-sub { list-style: none; margin: 0; padding: 0; }
.toc a {
  position: relative; display: block;
  padding: 7px 12px 7px 30px;
  color: var(--ink); text-decoration: none;
  font-size: 0.92rem; line-height: 1.5; border-radius: 6px;
}
/* 항목 앞의 작은 마름모 = 기판의 패드 */
.toc a::before {
  content: ""; position: absolute; left: 11px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  transform: rotate(45deg);
  background: #fff; border: 1.5px solid var(--line-strong);
}
.toc a:hover { background: var(--surface-2); }
.toc .toc-chapter { font-weight: 600; }
/* 절은 한 칸 들여쓰고, 왼쪽에 배선처럼 세로선 */
.toc-sub { margin-left: 14px; border-left: 1px solid var(--line); }
.toc-sub a { padding-left: 24px; font-size: 0.89rem; color: #46536a; }
.toc-sub a::before { left: 7px; width: 5px; height: 5px; margin-top: -2.5px; }
/* 지금 보고 있는 페이지 */
.toc a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc a.current::before { background: var(--accent); border-color: var(--accent); }
.toc-no { display: inline-block; min-width: 36px; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.toc a.current .toc-no { color: var(--accent); }
.toc-draft {
  font-size: 0.68rem; color: var(--danger); border: 1px solid currentColor;
  border-radius: 8px; padding: 0 5px; margin-left: 5px; vertical-align: 1px;
}
.toc-empty { padding: 14px; }

/* ----- 본문 2단 배치 ----- */
.doc-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.doc-layout { display: flex; gap: 22px; align-items: flex-start; }

.doc-sidebar {
  width: 268px; flex: 0 0 268px;
  padding: 0 0 10px;
  position: sticky; top: 16px;                  /* 스크롤해도 따라옴 */
  max-height: calc(100vh - 32px); overflow-y: auto;
  overflow-x: hidden;
}
/* 책 제목 띠: 목차 맨 위에 색을 넣어 어디가 목차인지 한눈에 보이게 (위키독스와 같은 방식) */
.doc-sidebar-head {
  padding: 12px 16px; margin-bottom: 8px;
  background: var(--accent);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.doc-sidebar-head a { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.94rem; display: block; }
.toc { padding: 0 8px; }

.doc-main { flex: 1; min-width: 0; max-width: 820px; padding: 18px 34px 30px; }
.doc-layout.toc-hidden .doc-sidebar { display: none; }
.doc-layout.toc-hidden .doc-main { margin: 0 auto; }

.doc-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid var(--line);
}
.toc-toggle {
  position: relative; font: inherit; font-size: 0.86rem; cursor: pointer;
  padding: 5px 13px 5px 28px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 6px;
}
/* 버튼 왼쪽의 목차 아이콘 (가로줄 세 개) */
.toc-toggle::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 7px;
  border-top: 2px solid currentColor; border-bottom: 2px solid currentColor;
}
.toc-toggle:hover { background: var(--surface-2); }
.doc-breadcrumb { font-size: 0.85rem; }
.doc-breadcrumb a { color: var(--muted); text-decoration: none; }
.doc-breadcrumb a:hover { color: var(--ink); }
.doc-tools { margin-left: auto; display: flex; gap: 12px; font-size: 0.85rem; }
.doc-tools a { text-decoration: none; color: var(--muted); }
.doc-tools a:hover { color: var(--accent); }

.doc-title { font-size: 1.7rem; margin: 0 0 6px; }
.doc-date { margin: 0 0 4px; font-size: 0.82rem; }
.doc-body { padding-top: 16px; min-height: 120px; line-height: 1.85; }
.doc-body h2 {
  font-size: 1.25rem; margin: 36px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.doc-body h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.doc-body > p { margin: 0 0 16px; }

/* 이전 / 다음 */
.doc-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-nav a {
  flex: 0 1 48%; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: 0.92rem; line-height: 1.5;
}
.doc-nav a:hover { border-color: var(--accent); background: var(--surface-2); }
.doc-nav a .muted { font-size: 0.78rem; }
.doc-nav-next { text-align: right; margin-left: auto; }

/* =========================================================
   7. 폼, 에러 화면, 내 활동
   ========================================================= */
.form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 20px;
}
.form.narrow, .narrow { max-width: 440px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; }
.field small { display: block; margin-top: 5px; font-size: 0.82rem; }
.field-checkbox { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.field-checkbox label { margin: 0; font-weight: 400; }
.field-checkbox input { width: auto; }
.field-checkbox small { flex-basis: 100%; margin: 0; }
.form button[type="submit"] { margin-right: 10px; }

/* 에디터 입력칸 최소 높이 */
.ck-editor__editable_inline { min-height: 340px; }

/* 내 활동 탭 */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a {
  padding: 9px 15px; text-decoration: none; color: var(--muted);
  margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 0.94rem;
}
.tabs a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.activity-list { padding: 4px 18px; }
.activity-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item a { color: var(--ink); text-decoration: none; }
.activity-item a:hover { text-decoration: underline; }
.activity-item p { margin: 3px 0 0; font-size: 0.82rem; }

/* 에러 화면 (404, 403 등) */
.error-page {
  text-align: center; padding: 72px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.error-page h1 { font-size: 1.3rem; margin: 10px 0; }
.error-code { font-size: 3.2rem; font-weight: 700; color: var(--line-strong); margin: 0; line-height: 1; }
.error-page .btn { margin-top: 16px; }

/* [19단계 추가] 가입 화면의 동의 영역 */
.agree-box { margin: 22px 0 18px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.agree-title { margin: 0 0 10px; font-weight: 600; font-size: 0.9rem; }
.agree-box .field-checkbox { margin-bottom: 10px; }
.agree-box .field-checkbox:last-of-type { margin-bottom: 0; }
.agree-box small { color: var(--muted); }

/* 약관 본문 */
.legal h2 { font-size: 1.05rem; margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.legal ul, .legal ol { padding-left: 22px; }
.legal li { margin-bottom: 4px; }
.legal table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 0.92rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.legal th { background: var(--surface-2); }

.footer-links { display: flex; justify-content: center; gap: 18px; margin: 0 0 10px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

.footer {
  padding: 48px 20px; margin-top: 56px;
  border-top: 1px solid var(--line); text-align: center; font-size: 0.85rem;
}

/* =========================================================
   8. 휴대폰 화면
   ========================================================= */
@media (max-width: 820px) {
  .doc-layout { flex-direction: column; gap: 0; }
  .doc-sidebar {
    width: 100%; flex: none; position: static; max-height: 46vh;
    padding: 0 0 10px; margin-bottom: 18px;
  }
  .doc-main { max-width: none; }
  .doc-nav { flex-direction: column; }
  .doc-nav a { flex: 0 1 100%; }
  .doc-nav-next { text-align: left; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .wrap, .doc-wrap { padding: 0 16px; }
  .col-author, .col-num { display: none; }      /* 좁은 화면에서는 작성자·조회수 숨김 */
  .hero h1 { font-size: 1.4rem; }
  .post h1, .doc-title { font-size: 1.3rem; }
  .form, .post, .book-cover { padding: 18px 16px; }
  .comments { padding: 16px; }
  .doc-main { padding: 14px 18px 22px; }
  .post-table th:first-child, .post-table td:first-child { padding-left: 12px; }
  .post-table th:last-child, .post-table td:last-child { padding-right: 12px; }
  .comment-form { grid-template-columns: 1fr; }
  .comment-form .btn { justify-self: end; }
  .board-nav a { padding: 10px 11px; font-size: 0.9rem; }
  .book-grid { grid-template-columns: 1fr; }
}
