/* RAYMSYS 기술블로그 (blog.raymsys.com) — 밝은 테마
   색·글꼴은 홈페이지(public/assets/css/style.css)와 같은 브랜드 값을 쓴다.
   페이지 마크업은 blog/tools/blog_build.py 가 만든다. 클래스 이름을 바꾸면 그쪽도 함께 맞춘다.
   배치: 상단바 / (첫 화면만) 소개 / 왼쪽 카테고리 트리 + 본문 / 하단바. 좁은 화면에서는 트리가 본문 위의 펼침 목록이 된다 */

/* JetBrains Mono 라틴 글자 (코드). 홈페이지의 글꼴 파일을 같이 쓴다 (SIL OFL 1.1) */
@font-face {
  font-family: "JetBrains Mono";
  src: url("https://www.raymsys.com/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --navy: #0f1921;
  --ink: #1b2434;
  --ink-2: #33414f;
  --muted: #5d6c75;
  --muted-2: #7c8a92;
  --deep: #0e8499;
  --deep-2: #0b6f80;
  --signal: #69c7d5;
  --tint: #e8f6f8;
  --tint-2: #d3eef2;
  --white: #ffffff;
  --paper: #f5f8f8;
  --paper-2: #eaf1f2;
  --line: #dbe4e6;
  --line-2: #e8eef0;
  --code-bg: #f4f7f8;

  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --max: 1240px;
  --narrow: 760px;
  --side: 232px;
  --top-h: 64px;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--top-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap.narrow {
  max-width: calc(var(--narrow) + var(--gutter) * 2);
}

.wrap.narrow-l {
  max-width: calc(880px + var(--gutter) * 2);
}

/* ---------- 상단바 ---------- */

.bh {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.bh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--top-h);
}

.bh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bh-mark {
  width: auto;
  height: 28px;
}

.bh-word {
  width: auto;
  height: 15px;
}

.bh-name {
  position: relative;
  padding-left: 12px;
  margin-left: 2px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--deep);
  white-space: nowrap;
}

.bh-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 16px;
  margin-top: -8px;
  background: var(--line);
}

.bh-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bh-search,
.bh-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}

.bh-search svg,
.bh-home svg {
  width: 15px;
  height: 15px;
}

.bh-search:hover,
.bh-home:hover,
.bh-search[aria-current] {
  background: var(--paper);
  color: var(--deep-2);
}

.bh-home {
  border: 1px solid var(--line);
}

/* ---------- 왼쪽 카테고리 트리 ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  align-items: start;
  gap: 48px;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.side-nav {
  position: sticky;
  top: calc(var(--top-h) + 24px);
  max-height: calc(100vh - var(--top-h) - 48px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.side-title {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.tree,
.tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree ul {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line-2);
}

.tree a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}

.tree a:hover {
  background: var(--paper);
  color: var(--deep-2);
}

.tree a.is-active {
  background: var(--tint);
  font-weight: 700;
  color: var(--deep-2);
}

.tree .t {
  flex: 1;
  min-width: 0;
}

.tree .n {
  flex: none;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: var(--muted);
}

.tree a.is-active .n {
  background: var(--tint-2);
  color: var(--deep-2);
}

.tree-all {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-2);
}

/* 하위 카테고리가 있는 항목: 왼쪽 화살표로 접고 편다 (링크를 누르면 그 카테고리로 간다) */
.tree summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
}

.tree summary::-webkit-details-marker {
  display: none;
}

.tree summary::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.6px solid var(--muted-2);
  border-bottom: 1.6px solid var(--muted-2);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.tree details[open] > summary::before {
  transform: rotate(45deg);
}

.tree > li:not(.tree-all) {
  padding-left: 10px;
}

/* 좁은 화면: 카테고리 펼침 목록 (넓은 화면에서는 숨긴다) */
.cat-drop {
  display: none;
  position: relative;
}

.cat-drop > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  list-style: none;
  cursor: pointer;
}

.cat-drop > summary::-webkit-details-marker {
  display: none;
}

.cat-drop > summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.cat-drop[open] > summary {
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(14, 132, 153, 0.12);
}

.cat-drop[open] > summary::after {
  top: 21px;
  transform: rotate(-135deg);
}

.cat-drop-k {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-2);
}

.cat-drop-v {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  color: var(--deep-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cat-drop > nav {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(60vh, 480px);
  overflow-y: auto;
  padding: 10px 8px 10px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 16px 40px rgba(15, 25, 33, 0.14);
}

/* 본문 머리 (카테고리·전체 글·검색) */
.page-head {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.page-count {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.subcats a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.subcats a:hover {
  border-color: var(--deep);
  color: var(--deep-2);
}

.subcats .n {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 18px;
  text-align: center;
  color: var(--muted);
}

/* ---------- 머리 영역 ---------- */

.intro {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4.5vw, 52px);
  background: linear-gradient(180deg, var(--tint) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--line-2);
}

.intro::after {
  content: "";
  position: absolute;
  right: -48px;
  top: 22px;
  width: min(420px, 50vw);
  aspect-ratio: 450 / 104;
  background: url("../img/RAYMSYS_waveband_cyan.svg") no-repeat center / contain;
  opacity: 0.22;
  pointer-events: none;
}

.intro .wrap {
  position: relative;
  z-index: 1;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: end;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deep);
}

.intro h1 {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.lede {
  max-width: 640px;
  margin: 14px 0 0;
  font-size: clamp(15.5px, 1.6vw, 17.5px);
  color: var(--ink-2);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.crumbs a {
  color: var(--deep-2);
}

.crumbs a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crumbs .sep {
  color: var(--line);
}

.crumbs span[aria-current] {
  color: var(--muted);
}

/* 찾기 칸 */
.search-box {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 6px 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(15, 25, 33, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(14, 132, 153, 0.14);
}

.search-box input {
  flex: 1;
  width: 0; /* 칸의 기본 폭(약 20글자)이 좁은 화면에서 상자를 밀어내지 않게 */
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font-size: 15.5px;
  outline: none;
}

.search-box input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-box button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: var(--deep);
  color: var(--white);
  cursor: pointer;
}

.search-box button:hover {
  background: var(--deep-2);
}

.search-box button svg {
  width: 17px;
  height: 17px;
}

.search-box.is-wide {
  max-width: 640px;
  margin-top: 22px;
}

/* ---------- 구역 ---------- */

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.sec-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.sec-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--deep-2);
  white-space: nowrap;
}

.sec-more svg {
  width: 15px;
  height: 15px;
  transition: transform 0.15s;
}

.sec-more:hover svg {
  transform: translateX(3px);
}

.empty {
  margin: 0;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: var(--white);
}

.empty a {
  color: var(--deep-2);
  text-decoration: underline;
}

/* ---------- 글 목록 카드 ---------- */

.post-list {
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.card:hover {
  border-color: var(--deep);
  box-shadow: 0 8px 24px rgba(15, 25, 33, 0.07);
}

.card-link {
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding: 22px 24px;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.card-meta time {
  font-family: var(--mono);
  font-size: 12.5px;
}

.card-meta .min::before {
  content: "·";
  margin-right: 10px;
  color: var(--line);
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--tint);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--deep-2);
  white-space: nowrap;
}

.card-title {
  margin: 8px 0 0;
  font-size: clamp(17.5px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.card:hover .card-title {
  color: var(--deep-2);
}

.card-sum {
  display: -webkit-box;
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-thumb {
  flex: none;
  width: 200px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-2);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 글 ---------- */

.post-head {
  margin-bottom: 8px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.post-head h1 {
  margin: 0;
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.post-lede {
  margin: 14px 0 0;
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.7;
  color: var(--ink-2);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.post-meta time {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.post-meta span::before {
  content: "·";
  margin-right: 12px;
  color: var(--line);
}

.post-head,
.post-main,
.post-foot {
  max-width: var(--narrow);
}

.post-aside {
  display: none;
}

/* 아주 넓은 화면: 본문 오른쪽에 목차를 붙여 둔다 (그보다 좁으면 본문 위의 접는 목차) */
@media (min-width: 1360px) {
  .post-body.has-toc {
    display: grid;
    grid-template-columns: minmax(0, var(--narrow)) 200px;
    gap: 40px;
  }

  .post-body.has-toc .post-aside {
    display: block;
  }

  .post-body.has-toc .toc-m {
    display: none;
  }
}

.toc {
  position: sticky;
  top: calc(var(--top-h) + 24px);
  max-height: calc(100vh - var(--top-h) - 48px);
  margin-top: 32px;
  overflow-y: auto;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.toc-title {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.toc ol,
.toc-m ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc li a,
.toc-m li a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  transition: color 0.15s;
}

.toc li.lv3 a,
.toc-m li.lv3 a {
  padding-left: 14px;
  font-size: 13.5px;
}

.toc li a:hover,
.toc-m li a:hover {
  color: var(--deep-2);
}

.toc li a.is-on {
  position: relative;
  font-weight: 700;
  color: var(--deep-2);
}

.toc li a.is-on::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--deep);
}

.toc-m {
  margin: 28px 0 0;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.toc-m summary {
  padding: 13px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}

.toc-m[open] summary {
  border-bottom: 1px solid var(--line);
}

.toc-m ol {
  padding: 8px 0 12px;
}

/* 본문 */
.prose {
  padding-top: 12px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
}

.prose > :first-child {
  margin-top: 24px;
}

.prose p {
  margin: 0 0 1.2em;
}

.prose h2 {
  margin: 2.4em 0 0.8em;
  padding-top: 0.2em;
  font-size: clamp(22px, 2.6vw, 26px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.prose h3 {
  margin: 2em 0 0.6em;
  font-size: clamp(19px, 2.1vw, 21px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--navy);
}

.prose h4 {
  margin: 1.8em 0 0.5em;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--ink);
}

.prose a {
  color: var(--deep-2);
  text-decoration: underline;
  text-decoration-color: rgba(14, 132, 153, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong {
  font-weight: 700;
  color: var(--navy);
}

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0.3em 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.3em 0;
}

.prose li > p {
  margin: 0 0 0.6em;
}

.prose li::marker {
  color: var(--deep);
}

.prose li.task {
  list-style: none;
  margin-left: -1.4em;
}

.prose li.task input {
  margin: 0 8px 0 0;
  vertical-align: -1px;
  accent-color: var(--deep);
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--signal);
  border-radius: 0 10px 10px 0;
  background: var(--tint);
  color: var(--ink-2);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.86em;
  color: #0b5d6b;
}

.prose pre {
  position: relative;
  margin: 1.6em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  font-size: 14px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

.prose pre[data-lang] {
  padding-top: 38px;
}

.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 10px;
  left: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.prose pre code {
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: inherit;
  color: var(--ink);
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.prose pre:hover .code-copy,
.code-copy:focus-visible,
.code-copy.is-done {
  opacity: 1;
}

.code-copy:hover {
  color: var(--deep-2);
}

.prose figure {
  margin: 2em 0;
}

.prose figure img,
.prose p img {
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

.prose p img {
  display: inline-block;
  vertical-align: middle;
}

.prose figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  color: var(--muted);
}

.table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--paper);
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose .al-c {
  text-align: center;
}

.prose .al-r {
  text-align: right;
}

/* 글 아래 */
.post-foot {
  padding-top: 8px;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.pn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
}

a.pn:hover {
  border-color: var(--deep);
  background: var(--tint);
}

.pn.newer {
  text-align: right;
}

.pn.is-empty {
  border-color: transparent;
}

.pn-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted-2);
}

.pn-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
}

.related {
  margin-top: 40px;
}

.related h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.related h2 a {
  color: var(--deep-2);
}

.related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}

.rel-title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}

.related li a:hover .rel-title {
  color: var(--deep-2);
}

.related time {
  flex: none;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted-2);
}

.post-back {
  margin: 36px 0 0;
}

.btn,
.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn {
  background: var(--deep);
  color: var(--white);
}

.btn:hover {
  background: var(--deep-2);
}

.btn-line {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-2);
}

.btn-line:hover {
  border-color: var(--deep);
  color: var(--deep-2);
}

.btn-line svg {
  width: 16px;
  height: 16px;
}

/* ---------- 전체 글 ---------- */

.arc-year + .arc-year {
  margin-top: 44px;
}

.arc-year h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
}

.arc-year h2 span {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.arc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.arc-list a {
  display: grid;
  grid-template-columns: 56px auto minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-2);
}

.arc-list time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.arc-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.arc-list a:hover .arc-title {
  color: var(--deep-2);
}

/* ---------- 404 ---------- */

.nf {
  min-height: 36vh;
  border-bottom: 0;
}

.nf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}

/* ---------- 하단바 ---------- */

.bf {
  padding: 36px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  color: var(--muted);
}

.bf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 32px;
}

.bf-name {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.bf-info {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bf-info .k {
  font-weight: 600;
  color: var(--muted-2);
}

.bf-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bf-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--ink-2);
}

.bf-links a:hover {
  color: var(--deep-2);
}

.bf-links svg {
  width: 13px;
  height: 13px;
}

.bf-copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ---------- 좁은 화면 ---------- */

@media (max-width: 1023px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 20px;
  }

  .side {
    display: none;
  }

  .cat-drop {
    display: block;
  }
}

@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --top-h: 56px;
  }

  .bh-word {
    display: none;
  }

  .bh-name {
    padding-left: 0;
    margin-left: 0;
    font-size: 16px;
  }

  .bh-name::before {
    display: none;
  }

  .bh-search span {
    display: none;
  }

  .bh-search {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .bh-home {
    padding: 0 10px;
    font-size: 13px;
  }

  .intro::after {
    opacity: 0.18;
  }

  .card-link {
    gap: 14px;
    padding: 18px;
  }

  .card-thumb {
    width: 92px;
    aspect-ratio: 1;
  }

  .prose {
    font-size: 16.5px;
    line-height: 1.8;
  }

  .prose pre {
    margin-left: calc(var(--gutter) * -1);
    margin-right: calc(var(--gutter) * -1);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    font-size: 13px;
  }

  .code-copy {
    opacity: 1;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .pn.newer {
    text-align: left;
  }

  .pn.is-empty {
    display: none;
  }

  .arc-list a {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px 12px;
  }

  .arc-list .chip {
    grid-column: 2;
    justify-self: start;
  }

  .arc-title {
    grid-column: 2;
  }

  .bf-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media print {
  .side,
  .cat-drop,
  .bh,
  .bf,
  .toc,
  .toc-m,
  .post-nav,
  .related,
  .post-back,
  .code-copy {
    display: none !important;
  }
}
