/* 침구급제요결 사이트 (pass.tcm-study.ca). 꼴 시안 v2를 Peter가 승인(2026-11-26). 시안: design/mockups/pass/.
   세계: 옛 판본(木版本) 주석서. 경(經)·해(解)·주(註) 짜임, 판광(版匡)의 굵고 가는 두 줄,
   주필(朱筆)의 붉은 표제와 권점(圈點). 읽는 칸은 조용히, 틀(머리·표제·차례·바닥)이 세계를 맡는다.
   v1에서 뺀 것: 둥근 카드, 알약, 테두리 상자, 흐림 머리, 눈썹 글, 강조 색 낱말, 마름모 글머리, 한쪽 막대 인용. */
:root {
  --paper: #f2efe8;
  --paper-2: #e8e3d8;
  --sheet: #faf8f3;
  --ink: #1c1a17;
  --ink-2: #3d3933;
  --muted: #645e55;
  --rule: #cfc7b8;
  --rule-2: #ddd6c9;
  --seal: #b3261e;
  --mark: rgba(247, 205, 70, .55);
  --serif: "Noto Serif KR", "AppleMyungjo", "Nanum Myeongjo", "Batang", serif;
  --sans: "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --col: 40rem;
  --frame: calc(var(--col) + var(--margin) + 2.5rem);  /* 머리·본문·바닥이 같은 폭으로 가운데에 (Peter 2026-11-26) */
  --margin: 7rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614; --paper-2: #221f1c; --sheet: #1d1b18;
    --ink: #ebe6dc; --ink-2: #cbc4b8; --muted: #a29b8f;
    --rule: #3e3a34; --rule-2: #2e2b27; --seal: #ef7564; --mark: rgba(214, 168, 40, .38);
    color-scheme: dark;
  }
}

/* 다크 모드: 단추 없이 기기 설정을 따른다(Peter 2026-11-26). */
/* 글씨 크기 고정(19px, 휴대폰 18px). Peter 2026-11-26 */
html { font-size: 118.75%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--rule) transparent; }
@media (max-width: 600px) { html { font-size: 112.5%; } }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1rem; line-height: 1.85;
  word-break: keep-all; overflow-wrap: break-word; caret-color: var(--seal);
}
::selection { background: color-mix(in srgb, var(--seal) 24%, transparent); color: var(--ink); }
a { color: inherit; text-decoration-line: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--seal); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.lat { font-family: var(--sans); font-size: .93em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* 판광(版匡): 굵은 줄과 가는 줄. 이 쪽의 한 가지 표지. 머리·經·바닥에만 쓴다. */
.kuang-top, .kuang-bot { position: relative; }
.kuang-top::before, .kuang-bot::after {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink);
}
.kuang-top::before { top: 0; }
.kuang-bot::after { bottom: 0; border-top-width: 1px; border-bottom-width: 3px; }

/* 머리 */
.hd { position: sticky; top: 0; z-index: 5; background: var(--paper); font-family: var(--sans); }
.hd::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; border-top: 1px solid var(--ink); border-bottom: 3px solid var(--ink); background: var(--paper); }
.hd-in { max-width: var(--frame); margin: 0 auto; padding: .45rem 1.25rem; display: flex; align-items: center; gap: 1rem; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-t { font-family: var(--serif); font-weight: 700; font-size: 1rem; white-space: nowrap; }
.where { font-family: var(--serif); font-weight: 700; color: var(--seal); font-size: 1rem; padding-left: .9rem; margin-left: .1rem; border-left: 1px solid var(--rule); line-height: 1.2; }
.nav { display: flex; gap: .2rem; margin-left: auto; }
.nav a { text-decoration: none; padding: .55rem .7rem; font-size: .85rem; color: var(--ink-2); }
.nav a:hover { color: var(--seal); }
.nav .off { padding: .55rem .7rem; font-size: .85rem; color: var(--muted); opacity: .6; }
.logo { flex: none; width: 2.3rem; height: 2.3rem; display: block; }
.logo .lg-ring { stroke: var(--seal); }
.logo .lg-eye { fill: var(--seal); }
.logo .lg-ndl { stroke: var(--ink); }
.logo .lg-coil { stroke: var(--paper); }
.logo .lg-tail { stroke: var(--ink); fill: none; }
@media (max-width: 760px) {
  .nav { display: none; }
}

/* 본문 틀: 읽는 칸 40rem, 넓은 화면에서는 왼쪽 여백(書眉)에 붉은 표제 */
main { max-width: var(--frame); margin: 0 auto; padding: 3rem 1.25rem 2rem; }
@media (min-width: 1000px) {
  main.piece { padding-left: calc(var(--margin) + 1.25rem); }
  main.piece > *, main.piece > article > * { max-width: var(--col); }
}
@media (max-width: 600px) { main { padding: 2rem 1.1rem 1.5rem; } }

/* 편 머리 */
.ph { margin: 0 0 2.6rem; }
h1.pt { font-size: 2.3rem; line-height: 1.32; font-weight: 700; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
@media (max-width: 600px) { h1.pt { font-size: 1.75rem; } }
.rdg { font-size: .72em; font-weight: 600; color: var(--ink-2); }
.where { font-weight: 700; }
.jump ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.jump li + li::before { content: "·"; color: var(--muted); padding: 0 .15rem; }
.jump a { display: inline-block; padding: .35rem .3rem; text-decoration: none; color: var(--ink-2); }
.jump a:hover { color: var(--seal); }

/* 편 사이 이동 */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; margin: 4rem 0 0; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.pager a, .pager > span { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; min-height: 2.75rem; color: var(--ink); }
.pager .pl { font-family: var(--sans); font-size: .78rem; color: var(--muted); }
.pager .pn { font-size: 1.1rem; font-weight: 700; }
.pager .pn small { font-family: var(--sans); font-weight: 400; font-size: .72em; color: var(--muted); }
.pager a:hover .pn { color: var(--seal); }
.pager .next { text-align: right; align-items: flex-end; }
.pager .toc { align-items: center; text-align: center; }
.pager .off .pn { color: var(--muted); font-weight: 600; }
@media (max-width: 600px) {
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .toc { grid-column: 1 / -1; order: 3; align-items: flex-start; text-align: left; }
}

/* 항목 표제(前問答 經 解 要訣 註 按 習 問) */
.lab { position: relative; margin: 3.4rem 0 1rem; font-size: 1.15rem; line-height: 1.5; font-weight: 700; scroll-margin-top: 5rem; }
.lab .mk { color: var(--seal); font-size: 1.45rem; letter-spacing: .04em; margin-right: .55rem; }
.lab .ln { color: var(--ink); }
.lab .rd { color: var(--seal); font-weight: 600; font-size: .85em; margin-right: .3rem; }
.ph + article > .lab:first-child { margin-top: 0; }
@media (min-width: 1000px) {
  .lab .mk {
    position: absolute; left: calc(-1 * var(--margin)); width: calc(var(--margin) - 1.4rem); top: -.2rem;
    text-align: right; font-size: 1.75rem; line-height: 1.2; margin: 0;
  }
}
h3.sub { font-size: 1.18rem; font-weight: 700; margin: 2.6rem 0 .5rem; scroll-margin-top: 5rem; }
h3.sub .d { font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--muted); margin-left: .5rem; }
p.cap { font-weight: 700; font-size: .98rem; color: var(--ink); margin: 1.8rem 0 .4rem; }

p { margin: 0 0 1.05em; }
b, strong { font-weight: 700; }
hr { border: 0; height: 0; margin: 2.6rem 0; }
ul.bl { margin: 0 0 1.1em; padding-left: 1.15em; }
ul.bl li { margin: .25em 0; }
ul.bl li::marker { color: var(--seal); }
.sig { text-align: right; margin-top: 2.2rem; }
a.url { overflow-wrap: anywhere; }

/* 經: 판광 두 줄 사이에 크게 */
blockquote { margin: .3rem 0 1.6rem; padding: 1.25rem 0 1.15rem; position: relative; }
blockquote::before, blockquote::after {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink);
}
blockquote::before { top: 0; }
blockquote::after { bottom: 0; border-top-width: 1px; border-bottom-width: 3px; }
blockquote p { margin: 0; font-size: 1.32rem; font-weight: 700; line-height: 1.6; text-wrap: balance; }
blockquote p + p { margin-top: .7rem; font-size: 1rem; font-weight: 400; color: var(--ink-2); line-height: 1.8; }

/* 표: 표는 줄을 쓴다(읽는 틀). 바깥 상자 없음, 머리 아래 먹줄 */
.tw { margin: .4rem 0 1.5rem; }
.tw-s { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tw-hint { display: none; font-family: var(--sans); font-size: .76rem; color: var(--muted); margin: .35rem 0 0; }
.tw.scroll .tw-hint { display: block; }
.tw.scroll.end .tw-hint { visibility: hidden; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-family: var(--sans); font-size: .86rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
table.wide { min-width: 34rem; }
table.wider { min-width: 40rem; }
th, td { padding: .5rem .75rem .5rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-2); }
th + th, td + td { padding-left: .75rem; }
thead th { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); border-top: 1px solid var(--ink); padding-top: .55rem; }
.c1 { position: sticky; left: 0; z-index: 1; background: var(--paper); }
td.c1 { font-weight: 600; min-width: 6.5em; }
thead th.c1 { z-index: 2; }
td[rowspan] { border-bottom-color: var(--rule); }
table.one td.c1 { position: static; font-weight: 400; }
@media (max-width: 600px) { table.wide .c1, table.wider .c1 { width: 8.5em; min-width: 6.5em; max-width: 9em; white-space: normal; box-shadow: 1px 0 0 var(--rule-2); } }
/* 형광펜: 시험 표기가 다른 낱말, 글자 아래쪽 절반에 (Peter 2026-11-26, 권점 대신) */
td b, th b {
  font-weight: 700; padding: 0 .12em; margin: 0 -.12em;
  background: linear-gradient(transparent 52%, var(--mark) 52%, var(--mark) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
td .lat, th .lat { font-size: 1em; }

/* 그림 */
figure { margin: 1.6rem 0 1.9rem; }
figure .fr { background: #fff; padding: .6rem; }
figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figcaption { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin-top: .55rem; }
@media (prefers-color-scheme: dark) { figure .fr { filter: brightness(.9); } }

/* 문제 */
.q { margin: 0 0 1.6rem; }
.q-stem { display: flex; gap: .55rem; margin: 0 0 .4rem; }
.q-n { flex: none; font-weight: 700; color: var(--seal); min-width: 1.3em; }
.opts { list-style: none; margin: 0 0 0 1.85em; padding: 0; }
.opts.plain { margin-left: 0; }
.opts li { margin: 0; }
.opts button, .opts.plain li {
  display: flex; align-items: baseline; gap: .7rem; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); background: transparent; border: 0; padding: .4rem .5rem; min-height: 2.75rem;
}
.opts.plain li { cursor: default; }
.opts button:hover { background: var(--paper-2); }
.opts .k {
  flex: none; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; margin: -.1rem 0;
  font-family: var(--sans); font-weight: 700; font-size: .85rem; color: var(--muted); border-radius: 50%; border: 1.5px solid transparent;
}
/* 고른 보기: 맞으면 붉은 동그라미(朱圈), 틀리면 붉은 빗금 */
.opts button[data-mark="ok"] .k { color: var(--seal); border-color: var(--seal); }
.opts button[data-mark="no"] .t { text-decoration: line-through; text-decoration-color: var(--seal); text-decoration-thickness: 2px; color: var(--muted); }
.opts button[data-mark="ans"] .k { color: var(--seal); border-color: var(--seal); border-style: dashed; }
.q-res { font-family: var(--sans); font-size: .85rem; color: var(--seal); margin: .3rem 0 0 2.4rem; min-height: 1.2em; }
ol.ans { margin: 0; padding-left: 1.4em; }
ol.ans li { margin: .35em 0; }
ol.ans li::marker { color: var(--seal); font-weight: 700; }

/* 접기 */
details.fold { margin: 0 0 1.2rem; }
details.fold summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem;
  font-family: var(--sans); font-weight: 600; font-size: .92rem; color: var(--seal);
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary:hover span { text-decoration: underline; text-underline-offset: .2em; }
.chev { width: 1rem; height: 1rem; flex: none; transition: transform .18s cubic-bezier(.2, .7, .2, 1); }
details[open] > summary .chev { transform: rotate(90deg); }
details.fold summary .cl { display: none; }
details.fold[open] summary .op { display: none; }
details.fold[open] summary .cl { display: inline; }
details.fold .fb { background: var(--paper-2); padding: 1rem 1.15rem .9rem; margin-top: .3rem; }
details.fold .fb > :last-child { margin-bottom: 0; }

.next-q { margin: 1rem 0 0; font-weight: 700; }
.next-q .off { font-family: var(--sans); font-weight: 400; font-size: .85rem; color: var(--muted); }

/* 틀린 곳 알리기 */
.report { margin: 4.2rem 0 0; font-family: var(--sans); }
.report h2 { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 .2rem; color: var(--seal); }
.report p.d { font-family: var(--serif); font-size: .95rem; color: var(--ink-2); margin: 0 0 1.2rem; }
.report .fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2rem; }
.report .fields > label[for="rp-name"] { grid-column: 1; grid-row: 1; }
.report .fields > #rp-name { grid-column: 1; grid-row: 2; }
.report .fields > label[for="rp-email"] { grid-column: 2; grid-row: 1; }
.report .fields > #rp-email { grid-column: 2; grid-row: 2; }
.report .fields > .hint { grid-column: 2; grid-row: 3; }
.report .fields > label[for="rp-msg"], .report .fields > textarea { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .report .fields { grid-template-columns: 1fr; }
  .report .fields > * { grid-column: 1 !important; grid-row: auto !important; }
}
.report label { display: block; font-size: .88rem; font-weight: 700; margin: .9rem 0 .35rem; color: var(--ink); }
.report input, .report textarea {
  width: 100%; font: inherit; font-size: .95rem; line-height: 1.6; padding: .65rem .75rem; min-height: 2.9rem;
  color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: 2px;
}
.report textarea { min-height: 7rem; resize: vertical; }
.report input:focus, .report textarea:focus { outline: 2px solid var(--seal); outline-offset: 0; border-color: transparent; }
.report .opt { font-weight: 400; color: var(--muted); }
.report .req { font-weight: 400; color: var(--seal); }
.report .hint { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.report input[aria-invalid="true"] { border-color: var(--seal); }
.report .row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; }
.report .msg { font-size: .88rem; color: var(--seal); }
.btn {
  display: inline-block; font: 700 .95rem/1 var(--sans); padding: .9rem 1.5rem; border-radius: 0; cursor: pointer;
  border: 0; background: var(--ink); color: var(--paper); text-decoration: none; min-height: 2.9rem;
}
.btn:hover { background: var(--seal); color: #fff; }
.btn:disabled { background: var(--paper-2); color: var(--muted); cursor: not-allowed; }

/* 바닥: 판광으로 닫는다 */
.ft { margin-top: 4rem; position: relative; font-family: var(--sans); color: var(--ink-2); }
.ft::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); }
.ft-in { max-width: var(--frame); margin: 0 auto; padding: 1.8rem 1.25rem 2.8rem; font-size: .85rem; line-height: 1.75; }
.ft-in p { margin: 0 0 .5rem; }
.ft-site { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: .95rem; }

/* ── 첫 화면 ── */
.hero { padding: .5rem 0 0; }
.hero h1 { margin: 0 0 1rem; font-weight: 700; line-height: 1.1; }
.hero h1 span { display: block; }
.hero h1 span:first-child { font-size: 1.5rem; color: var(--ink-2); font-weight: 600; margin-bottom: .45rem; letter-spacing: .02em; }
.hero h1 span:last-child { font-size: 4.6rem; letter-spacing: .03em; }
@media (max-width: 600px) {
  .hero h1 span:first-child { font-size: 1.2rem; }
  .hero h1 span:last-child { font-size: 2.85rem; }
}
.what { font-size: 1.15rem; font-weight: 600; color: var(--ink); margin: 0 0 2rem; max-width: 40rem; }
@media (max-width: 600px) { .what { font-size: 1.02rem; } }
.hero blockquote { max-width: 40rem; }
.hero blockquote p { font-size: 1.5rem; }
@media (max-width: 600px) { .hero blockquote p { font-size: 1.25rem; } }
.intro { font-size: 1.08rem; max-width: 38rem; margin: 1.8rem 0 .3rem; color: var(--ink); }
.intro-src { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin: 0; }

h2.sec { scroll-margin-top: 5rem; font-size: 1.5rem; margin: 4.6rem 0 1.3rem; color: var(--seal); }
h2.sec .d { font-family: var(--sans); font-size: .82rem; color: var(--muted); font-weight: 400; margin-left: .4rem; }

/* 새로 올린 편 */
.nw { display: grid; grid-template-columns: auto 1fr auto; column-gap: 1.2rem; align-items: baseline; text-decoration: none; padding: .2rem 0 .4rem; }
.nw-k { font-size: 1.45rem; font-weight: 700; color: var(--seal); }
.nw-t { font-size: 1.45rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.nw-j { grid-column: 2; font-size: 1.02rem; color: var(--ink-2); margin-top: .35rem; }
.nw-go { grid-column: 3; grid-row: 1; font-family: var(--sans); font-weight: 700; font-size: .9rem; color: var(--seal); }
.nw:hover .nw-t { color: var(--seal); }
.resume, .upnext { font-family: var(--sans); font-size: .88rem; color: var(--muted); margin: 1rem 0 0; }
.resume a { font-family: var(--serif); font-size: 1rem; font-weight: 700; color: var(--ink); margin-left: .4rem; }
.upnext > span { font-family: var(--serif); font-size: .98rem; color: var(--ink-2); margin-left: .4rem; }
@media (max-width: 600px) {
  .nw { grid-template-columns: 1fr auto; }
  .nw-k { grid-column: 1; }
  .nw-go { grid-column: 2; grid-row: 1; }
  .nw-t, .nw-j { grid-column: 1 / -1; }
  .nw-t { font-size: 1.3rem; }
  .upnext > span, .resume a { display: block; margin: .2rem 0 0; }
}

/* 차례(目錄): 점선 이음과 준비 중 */
.vol { border-top: 1px solid var(--rule); }
.vol:last-of-type { border-bottom: 1px solid var(--rule); }
.vol > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap;
  padding: 1rem 0 .9rem; min-height: 3.2rem;
}
.vol > summary::-webkit-details-marker { display: none; }
.vol .vt { font-size: 1.45rem; font-weight: 700; color: var(--seal); letter-spacing: .05em; line-height: 1.2; }
.vol .rd { font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.vol .vd { font-size: .95rem; color: var(--ink); }
.vol .vc { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.vol .vc .chev { color: var(--seal); }
.vol > summary:hover .vd { color: var(--seal); }
.vol ol { list-style: none; margin: 0 0 1.1rem; padding: 0; }
.vol li > a, .vol li.off {
  display: grid; grid-template-columns: 2.8rem auto 1fr auto; align-items: baseline; gap: 0 .5rem;
  padding: .42rem 0; text-decoration: none; min-height: 2.75rem;
}
.vol .no { font-family: var(--sans); font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.vol .tt { line-height: 1.55; }
.vol .ld { border-bottom: 2px dotted var(--rule); align-self: end; margin-bottom: .55rem; min-width: 1.5rem; }
.vol .st { font-family: var(--sans); font-size: .8rem; white-space: nowrap; }
.vol li > a .st { color: var(--seal); font-weight: 700; }
.vol li > a:hover .tt { color: var(--seal); }
.vol li.off { color: var(--muted); }
@media (max-width: 600px) {
  .vol li > a, .vol li.off { grid-template-columns: 2.2rem 1fr auto; }
  .vol .ld { display: none; }
  .vol .vc { margin-left: 0; flex-basis: 100%; }
}
.appx { margin: 1.4rem 0 0; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.appx .vt { font-size: 1.25rem; font-weight: 700; color: var(--seal); letter-spacing: .05em; }
.appx .rd { font-family: var(--sans); font-size: .8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.vol .no:empty { display: none; }
.vol li > a:has(.no:empty) { grid-template-columns: auto 1fr auto; }
@media (max-width: 600px) { .vol li > a:has(.no:empty) { grid-template-columns: 1fr auto; } }
