/* 하늘빛: 맑은 하늘색 바탕, 남색 글씨, 연보라·살구 포인트 (2026-10-27 사용자 선택) */
:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --ink: #1F2433;
  --muted: #6E7285;
  --line: #E2E6F0;
  --line-soft: #ECEFF5;
  --gold: #4A6FA5;   --peach: #E08A5A;
  --teal: #3F6797;   --teal-soft: #DCE8F7;
  --navy: #5E4C8F;   --navy-soft: #E8E1F4;
  --olive: #9A5632;  --olive-soft: #FBE5D6;
  --amber: #2F6B5E;  --amber-soft: #DDF0EA;
  --rose: #A0506A;   --rose-soft: #F6E3EA;
  --hero: #FFFFFF;   --hero-ink: #1F2433; --hero-muted: #4A6FA5;
  --diagram-ground: #FFFFFF;
  --f-display: "Gowun Batang", "AppleMyungjo", serif;
  --f-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-quote: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;
  color-scheme: light;
}
.c-teal  { --c: var(--teal);  --c-soft: var(--teal-soft); }
.c-navy  { --c: var(--navy);  --c-soft: var(--navy-soft); }
.c-olive { --c: var(--olive); --c-soft: var(--olive-soft); }
.c-amber { --c: var(--amber); --c-soft: var(--amber-soft); }
.c-rose  { --c: var(--rose);  --c-soft: var(--rose-soft); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: calc(16.5px * var(--rs, 1)); line-height: 1.8;
  word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--teal); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 머리말 */
.top { background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; color: var(--gold); text-decoration: none; }
.cats, .util { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.util { margin-left: auto; }
.cats a, .util a { color: var(--muted); text-decoration: none; font-size: .93rem; }
.cats a:hover, .util a:hover { color: var(--gold); }
.util .lockbar { color: var(--amber); }

.shell { max-width: 820px; margin: 0 auto; padding-block: 36px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.shell.home { max-width: 1180px; padding-top: 24px; }
.shell.with-side { max-width: 1180px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; }
main { min-width: 0; --c: var(--teal); --c-soft: var(--teal-soft); }

/* 첫 화면 */
.hero { background: var(--hero); color: var(--hero-ink); border: 1px solid var(--line); border-radius: 16px; padding: 36px 36px 32px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.hanja { font-family: var(--f-display); font-size: clamp(2.6rem, 6vw, 4rem); letter-spacing: .12em; line-height: 1.1; margin: 0; color: var(--hero-ink); }
.reading { margin: 10px 0 14px; color: var(--hero-muted); font-size: 1rem; }
.chars { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ch { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 10px; border: 1px solid rgba(74,111,165,.3); border-radius: 10px; }
.ch b { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; color: var(--hero-ink); line-height: 1.3; }
.ch small { font-size: .75rem; color: var(--hero-muted); }
.line { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.7; margin: 0 0 18px; color: var(--hero-ink); }
.stats { display: flex; gap: 22px; margin: 0; color: var(--hero-muted); font-size: .9rem; }
.stats b { color: var(--gold); font-size: 1.5rem; font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; }
.feature { display: block; background: var(--diagram-ground); border-radius: 12px; padding: 10px; text-decoration: none; color: var(--ink); }
.feature img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.feature span { display: block; font-size: .85rem; margin: 8px 2px 0; color: var(--ink); }

.home-body { margin-top: 28px; }
.mine { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--gold); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; }
.mine p { margin: 0; }
.btn { display: inline-block; background: var(--gold); color: #FFFFFF; text-decoration: none; padding: 7px 16px; border-radius: 8px; font-size: .93rem; }

.cards { list-style: none; margin: 0 0 36px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.cards a:hover { border-color: var(--c); }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--c-soft); color: var(--c);
  font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; }
.cards .t { font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; margin-top: 8px; }
.cards .desc { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.cards .meta { margin-top: auto; padding-top: 10px; color: var(--c); font-size: .82rem; }

.home-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; }
h2.sec { font-family: var(--f-display); font-size: 1.2rem; margin: 0 0 10px; }
aside h2.sec + * { margin-bottom: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tag { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px 14px; font-size: .88rem; color: var(--ink); text-decoration: none; }
.tag:hover { border-color: var(--gold); color: var(--gold); }
.now { list-style: none; margin: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; }
.now li + li { margin-top: 6px; }

.chip { display: inline-block; font-size: .72rem; font-weight: 400; background: var(--c-soft); color: var(--c); border-radius: 5px; padding: 1px 7px; margin-right: 8px; vertical-align: 2px; }

/* 목록 */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; text-decoration: none; color: var(--ink); }
.list a:hover .t { color: var(--c, var(--teal)); }
.list .t { font-weight: 700; }
.list .desc { color: var(--muted); font-size: .9rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list .meta { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.list.boxed { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.list.boxed li:last-child { border-bottom: 0; }
.list.boxed a { padding: 12px 16px; }
.sub { margin-bottom: 36px; }
.sub h2 { font-family: var(--f-display); font-size: 1.2rem; margin: 0 0 10px; color: var(--c); }

/* 글 */
.eyebrow { font-size: .85rem; color: var(--c); margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.eyebrow a { color: inherit; text-decoration: none; }
.lock { font-size: .72rem; border: 1px solid var(--amber); color: var(--amber); border-radius: 5px; padding: 0 6px; margin-left: 6px; }
h1 { font-family: var(--f-display); font-weight: 700; color: var(--ink); font-size: clamp(1.7rem, 3.6vw, 2.3rem); line-height: 1.35; margin: 6px 0 12px; text-wrap: balance; }
h1 .icon { margin-right: 12px; vertical-align: 6px; }
.lead { color: var(--muted); margin: 0 0 28px; }
.lead p { margin: 0 0 8px; }
.dateline { color: var(--muted); font-size: .88rem; margin: 0 0 4px; }
.source { color: var(--amber); }
.edit { margin-left: 12px; font-size: .82rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 10px; text-decoration: none; color: var(--ink); background: var(--surface); }
.edit:hover { border-color: var(--gold); color: var(--gold); }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 16px 0 26px; }

.diagram { margin: 0 0 32px; }
.diagram a { display: block; background: var(--diagram-ground); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.diagram img { display: block; width: 100%; }
.diagram figcaption { color: var(--muted); font-size: .8rem; margin-top: 6px; }

.note { margin-top: 24px; }
.note h2 { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.45; margin: 40px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); text-wrap: balance; }
.note h3 { font-family: var(--f-display); font-size: 1.1rem; color: var(--c); margin: 26px 0 8px; }
.note p, .note ul, .note ol { margin: 0 0 14px; }
.note ul, .note ol { padding-left: 1.4em; }
.note li { margin-bottom: 4px; }
.note li ul, .note li ol { padding-left: 1.1em; margin: 4px 0 6px; }
.note strong { font-weight: 700; }
.note blockquote { margin: 0 0 18px; padding: 14px 20px; line-height: 1.8; }
.note blockquote p:last-child, .note blockquote ul:last-child { margin-bottom: 0; }
.note hr { border: 0; border-top: 1px dashed var(--line); margin: 28px 0; }
.note img { border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
.note table { border-collapse: collapse; font-size: .9rem; line-height: 1.55; width: 100%; }
.note th, .note td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.note th { color: var(--muted); font-size: .82rem; }
.supp { font-size: .78em; color: var(--amber); white-space: nowrap; }
.orig { margin-top: 40px; font-size: .9rem; }

/* 노트 묶음 목차 */
.side { min-width: 0; position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow-y: auto; }
.side .coll { display: block; font-family: var(--f-display); font-weight: 700; color: var(--ink); text-decoration: none; margin-bottom: 10px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side .grp { font-size: .74rem; letter-spacing: .06em; color: var(--muted); margin: 14px 0 2px; }
.side a:not(.coll) { display: flex; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .9rem; line-height: 1.45; }
.side a:not(.coll):hover { background: var(--line-soft); }
.side a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.side .code { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.4em; }
.side a[aria-current="page"] .code { color: inherit; opacity: .75; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 52px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: .9rem; }
.pager .next { margin-left: auto; }

/* 구조도 모아보기 */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery li.wide { grid-column: 1 / -1; }
.gallery a { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: var(--diagram-ground); border-radius: 6px; border: 1px solid var(--line-soft); margin-bottom: 6px; }
.gallery li.wide img { aspect-ratio: auto; }
.gallery .t { font-weight: 700; }
.gallery .meta { color: var(--muted); font-size: .8rem; }

/* 검색 */
.search input { width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); margin: 6px 0 12px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.foot p { max-width: 1180px; margin: 0 auto; padding-block: 20px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cols { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell.with-side { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .side { position: static; max-height: none; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); }
  .side ul { max-height: 220px; overflow-y: auto; }
}
@media (max-width: 560px) {
  .hero { padding: 26px 20px; border-radius: 12px; }
  .util { margin-left: 0; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}
.brand small { font-family: var(--f-display); font-size: .78rem; font-weight: 400; color: var(--muted); margin-left: 8px; letter-spacing: .08em; }
.hanja { text-shadow: none; }
.cards a { background: var(--surface); }
.cards a:hover, .gallery a:hover { border-color: var(--gold); }
a { color: var(--teal); }
.orig a { color: var(--gold); }

/* 첫 화면 전시실: 이름 줄 + 구조도 벽(큰 작품 하나, 작은 작품 둘) */
.hero { padding: 30px 32px 22px; }
.hero-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 28px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.hero-head .hanja { font-size: clamp(2.2rem, 5vw, 3.2rem); }
.hero-head .reading { margin: 0 0 8px; }
.hero-head .chars { margin: 0; }
.hero-head .ch { min-width: 54px; padding: 4px 8px; }
.hero-head .ch b { font-size: 1.1rem; }
.hero-head .stats { flex-direction: column; gap: 2px; text-align: right; }
.gallery-wall { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 18px 22px; margin-top: 24px; }
.work { margin: 0; }
.work.main { grid-row: 1 / span 2; }
.work a { display: block; background: var(--diagram-ground); padding: 12px; border-radius: 4px; box-shadow: 0 8px 24px rgba(60, 45, 20, .12); border: 1px solid var(--line); transition: transform .2s ease; }
.work a:hover { transform: translateY(-2px); }
.work img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.work.main img { aspect-ratio: 4 / 3; }
.work figcaption { margin-top: 10px; font-size: .82rem; color: var(--muted); }
.work .no { color: var(--gold); margin-right: 8px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.wall-more { text-align: right; margin: 14px 0 0; font-size: .88rem; }
.wall-more a { color: var(--gold); text-decoration: none; }
@media (max-width: 900px) {
  .hero-head { grid-template-columns: minmax(0, 1fr); }
  .hero-head .stats { flex-direction: row; text-align: left; }
  .gallery-wall { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .work.main { grid-column: 1 / -1; grid-row: auto; }
}
@media (prefers-reduced-motion: reduce) { .work a { transition: none; } }
.sub.solo .list .t { font-family: var(--f-display); font-size: 1.2rem; color: var(--c); }

/* 사료 카드: 제목 · □ 출처 · 본문 · ※ 보충 설명 */
.note blockquote.saryo { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px 16px; margin: 0 0 22px; }
.note .saryo-title { font-family: var(--f-display); font-size: 1.05rem; margin: 0 0 2px; color: var(--ink); }
.note .saryo-title strong { font-weight: 700; }
.note .saryo-src { font-family: var(--f-body); font-size: .84rem; color: var(--muted); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.note blockquote.saryo p { line-height: 1.85; }
.note .saryo-note { font-family: var(--f-body); font-size: .84rem; color: var(--muted); margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* 첨부파일 목록 (내 서재 전용) */
.files { margin-top: 40px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.files h2 { font-family: var(--f-display); font-size: 1.05rem; margin: 0 0 10px; }
.files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; }
.files a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.files a:hover { color: var(--gold); border-color: var(--gold); }
.files .ext { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* 블로그에서 가져온 서식: 굵게(고운돋움은 굵은 글꼴이 없어 획을 덧그린다), 밑줄, 글자색, 형광펜 */
.note strong, .note b { font-weight: 700; -webkit-text-stroke: 0.45px currentColor; paint-order: stroke fill; }
.note u { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.note .ink-red { color: #C0503A; }
.note .ink-green { color: #2F6B4F; }
.note .ink-blue { color: #2E4A8A; }
.note mark { background: #FCEBC4; color: inherit; padding: 0 2px; border-radius: 2px; }

/* 수업 노트: 과목 카드 (강의 제목 · 수강 학기 · 교수) */
.course-cards { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.course-cards a { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 120px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.course-cards a:hover { border-color: var(--teal); transform: translateY(-2px); }
.course-cards .t { font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.course-cards .info { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .85rem; }
.course-cards .info span + span::before { content: "·"; margin-right: 10px; }

/* 인용구 네 가지: ① 안내 ② 인용 ③ 사료·책 카드(.saryo) ④ 강의 내용 */
.note blockquote.callout { background: var(--c-soft); border-radius: 10px; padding: 12px 18px; }
.note blockquote.callout strong:first-child { color: var(--c); }
.note blockquote.band { padding: 10px 18px; }
.note blockquote.band p { font-family: var(--f-display); font-size: 1.05rem; }
.note blockquote.quote { font-family: var(--f-quote); font-size: .96rem; border-left: 3px solid var(--peach); border-radius: 0; padding: 4px 0 4px 20px; color: #2A2F3D; position: relative; }
.note blockquote.handout p { margin: 0 0 2px; padding-left: 1.1em; text-indent: -1.1em; }
.note blockquote.handout p.cont { text-indent: 0; }
.note blockquote.handout p.gap { margin-top: .8em; }
.note blockquote.handout p.l1 { margin-left: 1.4em; } .note blockquote.handout p.l2 { margin-left: 2.8em; } .note blockquote.handout p.l3 { margin-left: 4.2em; } .note blockquote.handout p.l4 { margin-left: 5.6em; } .note blockquote.handout p.l5 { margin-left: 7em; }
.note blockquote.quote > p:first-child::before { content: "\201C"; font-family: Georgia, serif; font-size: 1.9rem; line-height: 0; color: var(--peach); vertical-align: -.42em; margin-right: 4px; }
.note blockquote.quote p:last-child:not(:first-child)[data-cite], .note blockquote.quote .cite { font-size: .84rem; color: var(--muted); text-align: right; }
.note blockquote.book .saryo-title { color: var(--ink); }
.note blockquote.lecture { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 0; padding: 12px 20px 14px; margin: 0 0 22px; }
.note .lecture-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .86rem; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.note .lecture-head strong { color: var(--teal); }
.note .lecture-head span { color: var(--muted); }
.note blockquote.book { padding: 14px 20px; }
.note blockquote.book .saryo-src { margin: 0; padding: 0; border: 0; }

/* 블로그식 제목 상자 → 두 단계 제목 (시안 D): 위는 큰 제목 + 짧은 주홍 선, 아래는 여백에 매단 번호 */
.note h2.sec-top { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; margin: 40px 0 20px; padding-bottom: 12px; position: relative; }
.note h2.sec-top::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 2px; background: var(--peach); }
.note h3.sec-sub { position: relative; font-family: var(--f-display); font-size: 1.12rem; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.note h3.sec-sub .no { font-size: .8rem; font-weight: 400; color: var(--peach); letter-spacing: .04em; margin-right: 10px; }
@media (min-width: 900px) { .note h3.sec-sub .no { position: absolute; left: -44px; top: .35em; margin: 0; } }
.note h3.sec-top { font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; color: var(--ink); margin: 34px 0 16px; padding-bottom: 10px; position: relative; }
.note h3.sec-top::after { content: ""; position: absolute; left: 0; bottom: 0; width: 30px; height: 2px; background: var(--peach); }
.note h2.sec-top small { display: block; font-family: var(--f-body); font-size: .82rem; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* 내 서재 · 공개·비공개 관리 */
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn.dark { background: var(--ink); }
.btn.danger { background: var(--rose); }
.btn { border: 0; cursor: pointer; font: inherit; }
.manage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 8px; z-index: 2; }
.manage-bar select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.manage-bar #count { color: var(--muted); font-size: .9rem; margin-right: auto; }
.manage-msg { min-height: 1.5em; color: var(--gold); font-size: .92rem; }
table.manage { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.manage th { text-align: left; font-weight: 400; color: var(--muted); font-size: .82rem; border-bottom: 1px solid var(--line); padding: 6px; }
table.manage td { border-bottom: 1px solid var(--line-soft); padding: 9px 6px; vertical-align: middle; }
table.manage td:first-child { width: 32px; }
table.manage td a { color: var(--ink); text-decoration: none; font-weight: 700; }
table.manage td small { display: block; color: var(--muted); font-size: .8rem; }
.state { font-size: .8rem; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.state.on { background: var(--teal-soft); color: var(--teal); }
.state.off { background: var(--olive-soft); color: var(--olive); }

.empty { color: var(--muted); padding: 24px 0; }
.recs { margin-top: 40px; }
.recs h2 { font-family: var(--f-display); font-size: 1.2rem; margin: 0 0 12px; }
.crosslink { margin: -6px 0 18px; font-size: .9rem; } .crosslink a { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--c-soft, var(--teal-soft)); color: var(--c, var(--teal)); text-decoration: none; }

/* 각주 */
.note sup[id^="fnref"] a { color: var(--gold); text-decoration: none; font-size: .78em; padding: 0 1px; }
.note .footnote { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.note .footnote h2 { font-size: .95rem; margin: 0 0 8px; padding: 0; border: 0; color: var(--ink); }
.note .footnote ol { padding-left: 1.4em; margin: 0; }
.note .footnote li { margin: 4px 0; }
.note .footnote li p { margin: 0; display: inline; }
.note .footnote-backref { text-decoration: none; margin-left: 4px; color: var(--gold); }

/* 메인 화면 개념어 지도 */
.cmap { max-width: 1100px; margin: 40px auto; padding: 0 20px; }
.cmap-head { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 20px; margin-bottom: 12px; }
.cmap-head h2 { font-family: var(--f-display); font-size: 1.4rem; margin: 0; }
.cmap-head p { flex: 1 1 360px; margin: 0; color: var(--muted); font-size: .92rem; }
#cmap-q { font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; min-width: 180px; }
#cmap-box { height: 600px; background: #1F2433; border-radius: 16px; overflow: hidden; }
#cmap-box text { font-size: 10px; fill: #E8ECF5; pointer-events: none; paint-order: stroke; stroke: #1F2433; stroke-width: 3px; }
@media (max-width: 700px) { #cmap-box { height: 440px; } }

/* 내 서재: 강의 정보 고치기 */
.course-cards li { position: relative; }
.course-cards .cedit { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .95rem; padding: 4px 6px; border-radius: 6px; }
.course-cards .cedit:hover { color: var(--teal); background: var(--line-soft); }
.dateline .cedit { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; margin-left: 10px; }
.cedit-form { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; padding: 16px 18px; margin: 4px 0 12px; background: var(--surface); border: 1px solid var(--teal); border-radius: 12px; }
.cedit-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.cedit-form input { font: inherit; font-size: 1rem; color: var(--ink); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, #fff); }
.cedit-form .row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cedit-form .msg { color: var(--muted); font-size: .88rem; }

/* 코너 화면: 분류 칩 + 찾기, 분류마다 최근 3편 */
.browse-bar { margin: 4px 0 26px; }
.browse-q { width: 100%; box-sizing: border-box; font: inherit; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); margin-bottom: 12px; }
.browse-q:focus { outline: none; border-color: var(--c, var(--teal)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { font: inherit; font-size: .86rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip span { font-size: .78rem; opacity: .75; margin-left: 2px; }
.chip:hover { border-color: var(--c, var(--teal)); color: var(--ink); }
.chip.on { background: var(--c, var(--teal)); border-color: var(--c, var(--teal)); color: #fff; }
.sub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.see-all { border: 0; background: none; font: inherit; font-size: .86rem; color: var(--c, var(--teal)); cursor: pointer; padding: 0; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }
.list li.more { display: none; }
.browse-empty { color: var(--muted); }
.crosslink.end { margin-top: 28px; }
.foot .visits { display: block; margin-top: 6px; font-variant-numeric: tabular-nums; }
.top .util .sub-btn { color: var(--teal); font-weight: 700; }

/* 구조도: 페이지에 직접 넣은 SVG + 확대 버튼(dia.js) */
.diagram.live .dia-view { background: var(--diagram-ground); border: 1px solid var(--line); border-radius: 10px; overflow: auto; -webkit-overflow-scrolling: touch; max-height: 85vh; }
.diagram.live .dia-view svg { display: block; width: 100%; height: auto; }
.diagram.live .dia-tools { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-bottom: 6px; }
.diagram.live .dia-tools button { min-width: 36px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: .9rem; cursor: pointer; }
.diagram.live .dia-tools button:hover { border-color: currentColor; }
.diagram.live .dia-tools .dia-pct { min-width: 56px; font-variant-numeric: tabular-nums; }
.diagram.live .dia-tools a { font-size: .85rem; margin-left: 4px; color: var(--muted); }
/* 상자형 구조도(HTML): 폭은 고정, 글자만 --sdk 배율로 */
.sd { --sdk: 1; font-size: calc(16px * var(--sdk)); line-height: 1.5; color: #1F2A33; background: var(--diagram-ground); border: 1px solid var(--line); border-radius: 12px; padding: 1.2em; overflow-wrap: anywhere; }
.sd-title { font-size: 1.6em; font-weight: 700; line-height: 1.3; margin: .2em 0 .4em; }
.sd-head { font-weight: 700; font-size: 1.1em; margin: 1.2em 0 .5em; }
.sd-note { font-size: .95em; margin: .4em 0; }
.sd-note[data-c] { text-align: center; }
.sd-row { display: grid; gap: .8em; align-items: stretch; margin: .5em 0; }
.sd-box { border: 1.5px solid; border-radius: 10px; padding: .7em .9em; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.sd-box .t { line-height: 1.35; margin-bottom: .3em; }
.sd-box [data-c] { text-align: center; }
.sd-box ul { margin: .2em 0 0; padding-left: 1.1em; }
.sd-box li { margin: .15em 0; }
.sd-box li.arrow { list-style: "→ "; }
.sd-arrow { text-align: center; color: #9AA8B0; font-size: 1.3em; line-height: 1; margin: .1em 0; }
@media (max-width: 640px) { .sd-row { grid-template-columns: 1fr !important; } .sd { padding: .9em; } }
/* 연구 노트: 분류마다 제목·날짜만 두 줄 격자 */
.sub-n { color: var(--muted); font-size: .9rem; }
.compact { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 24px; }
.compact li { border-bottom: 1px solid var(--line); }
.compact a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; text-decoration: none; color: var(--ink); }
.compact a:hover .t { color: var(--teal); }
.compact .t { font-size: .97rem; line-height: 1.45; }
.compact .meta { color: var(--muted); font-size: .78rem; white-space: nowrap; }
/* 철학자 정리: 지역·시대 칸에 이름 카드 */
.phil-group { margin: 14px 0 22px; }
.phil-group h3 { font-size: 1rem; margin: 0 0 8px; color: var(--teal); }
.phil-group h3 span { color: var(--muted); font-weight: 400; font-size: .85rem; }
.phil-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.phil-grid a { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--ink); height: 100%; box-sizing: border-box; }
.phil-grid a:hover { border-color: var(--teal); }
.phil-grid .t { font-weight: 700; font-size: .98rem; }
.phil-grid .o { color: var(--muted); font-size: .74rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phil-grid .y { color: var(--muted); font-size: .74rem; }
/* 연구 노트: 최근 책장 + 분류 탭 + 표 */
.shelf { display: flex; align-items: flex-end; gap: 5px; padding: 0 6px; border-bottom: 4px solid var(--line); min-height: 200px; overflow-x: auto; margin-bottom: 26px; }
.spine { flex: 0 0 auto; width: 44px; display: flex; align-items: flex-start; justify-content: center; padding: 10px 0; border-radius: 4px 4px 0 0; background: var(--c-soft); border: 1px solid var(--c); border-bottom: 0; color: var(--c); text-decoration: none; transition: transform .15s; }
.spine:hover { transform: translateY(-6px); }
.spine span { writing-mode: vertical-rl; font-size: .88rem; font-weight: 600; line-height: 1.2; max-height: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rtabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.rtab { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.rtab b { display: block; font-size: .98rem; }
.rtab span { color: var(--muted); font-size: .82rem; }
.rtab.on { background: var(--c-soft); border-color: var(--c); }
.rtable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.rtable th { text-align: left; color: var(--muted); font-weight: 400; font-size: .8rem; border-bottom: 1px solid var(--line); padding: 6px 4px; }
.rtable td { border-bottom: 1px solid var(--line); padding: 9px 4px; vertical-align: top; }
.rtable td a { color: var(--ink); text-decoration: none; } .rtable td a:hover { color: var(--teal); }
.rtable .k, .rtable .d { color: var(--muted); font-size: .8rem; white-space: nowrap; width: 1%; padding-left: 14px; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--rose-soft, #f6e3e3); color: var(--rose, #a5443f); font-size: .72rem; font-weight: 600; vertical-align: 1px; }
@media (max-width: 640px) { .rtable .k { display: none; } }
/* ---- 구조도 블록(tools/vis.py): 글자 크기는 .sd의 --sdk 배율을 따른다 ---- */
.vis { --vt: var(--teal); --vo: #C2410C; --vr: #B23A2B; --vg: #9AA8B0; }
.vis .vp { display: block; color: var(--muted); font-size: .78em; margin-top: .15em; }
.vis .vd { display: block; color: var(--muted); font-size: .88em; line-height: 1.4; margin-top: .2em; }
.vis b { font-weight: 700; }
/* 여정 */
.vtrack { position: relative; height: calc(var(--lv) * 2.2em + 1.6em); margin: 1.2em 0 .4em; }
.vtrack .vin { position: absolute; inset: .8em 0; }
.vtrack svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vtrack path { fill: none; stroke: var(--vg); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.vtrack .vdot { position: absolute; width: 1.1em; height: 1.1em; margin: -.55em 0 0 -.55em; border-radius: 50%; border: 2px solid var(--vt); background: var(--surface); }
.vdot.low { border-color: var(--vr); } .vdot.peak { border-color: var(--vo); background: #FDEBDD; }
.vlabels { display: grid; gap: .6em; text-align: center; }
.vcol { border-top: 3px solid var(--vt); padding-top: .4em; font-size: .92em; }
.vcol.low { border-color: var(--vr); } .vcol.peak { border-color: var(--vo); }
/* 대립 */
.vpair { display: grid; grid-template-columns: 1fr auto 1fr; gap: .8em; align-items: stretch; margin-top: .8em; }
.vside { border: 1.5px solid var(--vg); border-radius: 12px; padding: .8em 1em; background: var(--surface); }
.vside.right { border-color: var(--vt); background: var(--teal-soft); }
.vside .vh { font-weight: 700; font-size: 1.08em; margin-bottom: .4em; }
.vside ul { margin: 0; padding-left: 1.1em; } .vside li { margin: .25em 0; }
.vaxis { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; color: var(--vo); text-align: center; max-width: 7em; }
.varrow { font-size: 2em; line-height: 1; }
/* 핵심 */
.vring { border-radius: 1.6em; padding: .8em 1.1em; margin-top: .6em; border: 1.5px solid var(--vo); background: #FDF3EA; }
.vring.r1 { border-color: var(--vt); background: var(--teal-soft); }
.vring.r0 { border-color: #5E4C8F; background: #EEE9F7; text-align: center; }
.vring.r2, .vring.r3, .vring.r4 { border-color: var(--vo); background: #FDF3EA; }
.vring > .vl { margin-bottom: .2em; }
/* 연표 */
.vline { list-style: none; margin: 1em 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(7em, 1fr); gap: .6em; overflow-x: auto; border-top: 2px solid var(--vg); }
.vline li { position: relative; padding-top: 1.1em; }
.vline .vdot { position: absolute; top: -.55em; left: 0; width: .9em; height: .9em; border-radius: 50%; background: var(--surface); border: 2px solid var(--vt); }
.vyear { display: block; color: var(--vo); font-weight: 700; font-size: .95em; }
/* 관계도 */
.vrels { list-style: none; margin: .8em 0 0; padding: 0; display: grid; gap: .5em; }
.vrels li { display: grid; grid-template-columns: minmax(6em, 1fr) 1.4fr minmax(6em, 1fr); align-items: center; gap: .6em; }
.vnode { border: 1.5px solid var(--vt); border-radius: 999px; padding: .3em .8em; text-align: center; font-weight: 700; background: var(--surface); }
.vnode.to { border-color: var(--vo); }
.vrel { text-align: center; color: var(--muted); font-size: .9em; border-bottom: 2px solid var(--vg); padding-bottom: .2em; position: relative; }
.vrel::after { content: "▶"; position: absolute; right: -.4em; bottom: -.65em; color: var(--vg); font-size: .8em; }
/* 순환 */
.vsteps { list-style: none; counter-reset: st; margin: .8em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5em; align-items: stretch; }
.vsteps li { counter-increment: st; flex: 1 1 8em; border: 1.5px solid var(--vt); border-radius: 12px; padding: .6em .8em; background: var(--surface); position: relative; }
.vsteps li::before { content: counter(st); color: var(--vo); font-weight: 700; margin-right: .3em; }
.vsteps li .vl { display: inline; }
.vback { margin-top: .5em; color: var(--vo); font-size: .9em; text-align: right; }
@media (max-width: 640px) { .vpair { grid-template-columns: 1fr; } .vaxis { flex-direction: row; max-width: none; } .vrels li { grid-template-columns: 1fr; } }
/* 오른쪽 목차(toc.js) */
.toc { display: none; }
.toc-btn { display: none; }
@media (min-width: 1240px) {
  .shell.with-toc { max-width: 1100px; grid-template-columns: minmax(0, 1fr) 210px; display: grid; gap: 40px; }
  .shell.with-side.with-toc { max-width: 1440px; grid-template-columns: 230px minmax(0, 1fr) 210px; }
  .toc { display: block; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: .84rem; border-left: 1px solid var(--line); padding-left: 14px; }
}
@media (max-width: 1239px) {
  .toc-btn { display: block; position: fixed; right: 16px; bottom: 18px; z-index: 40; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.12); cursor: pointer; }
  .toc.open { display: block; position: fixed; right: 16px; bottom: 66px; z-index: 40; width: min(300px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.15); font-size: .9rem; }
}
.toc-h { margin: 0 0 8px; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc li a { display: block; padding: 4px 6px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc li.h3 a { padding-left: 18px; font-size: .92em; }
.toc li a:hover { color: var(--ink); background: var(--line-soft, rgba(0,0,0,.04)); }
.toc li.on > a { color: var(--teal); font-weight: 700; background: var(--teal-soft); }
.toc-top { display: block; margin-top: 10px; color: var(--muted); font-size: .8rem; text-decoration: none; }
/* 구조도 넘겨 보기(dia.js) */
.dia-carousel { margin: 18px 0 28px; }
.dia-track { display: flex; align-items: flex-start; transition: height .25s; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 0; scrollbar-width: none; }
.dia-track::-webkit-scrollbar { display: none; }
.dia-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: 0 2px; box-sizing: border-box; }
.dia-slide figure.diagram { margin: 0; }
.dia-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.dia-nav button.prev, .dia-nav button.next { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.dia-nav button.prev:hover, .dia-nav button.next:hover { border-color: var(--teal); color: var(--teal); }
.dia-nav .dots { display: flex; gap: 6px; }
.dia-nav .dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.dia-nav .dots button.on { background: var(--teal); width: 22px; border-radius: 6px; }
.dia-nav .count { color: var(--muted); font-size: .8rem; min-width: 3em; text-align: center; }
/* '한 줄 요약' 같은 머리말: 고운돋움에는 굵은 글꼴이 없어 굵게가 흐리게 보이므로 색 꼬리표로 */
.lbl { display: inline-block; margin-right: 8px; padding: 1px 10px; border-radius: 999px; background: var(--c-soft, var(--teal-soft)); color: var(--c, var(--teal)); font-family: var(--f-display); font-weight: 700; font-size: .85em; vertical-align: 1px; }
/* ---- 상자·인용 다시 꾸미기 (2026-11-10) ---- */
/* 안내 상자: 인용이 아닌 일반 상자 */
.note blockquote.box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--teal)); border-radius: 0 10px 10px 0; padding: 12px 18px; }
/* 강의안·발제문 옮김 */
.note blockquote.handout { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 14px 20px; font-size: .96rem; }
/* 책·글 인용: 따옴표 그림 대신 연한 바탕 + 명조 + 오른쪽 출처 */
.note blockquote.quote { font-family: var(--f-display); font-size: 1.02rem; line-height: 1.85; color: var(--ink); background: var(--c-soft, var(--teal-soft)); border: 0; border-radius: 12px; padding: 16px 22px 14px 48px; position: relative; }
.note blockquote.quote > p:first-child::before { content: "“"; position: absolute; left: 16px; top: 6px; font-family: var(--f-display); font-size: 2.6rem; line-height: 1; color: var(--c, var(--teal)); opacity: .55; margin: 0; vertical-align: 0; }
.note blockquote.quote p:last-child:not(:first-child)[data-cite], .note blockquote.quote .cite { font-family: var(--f-body); font-size: .82rem; color: var(--muted); text-align: right; }
/* 한국어 줄바꿈: 낱말 중간에서 끊지 않고(keep-all), 제목은 줄 길이를 고르게(balance) */
body { word-break: keep-all; overflow-wrap: break-word; }
h1, h2, h3, h4, .sec-top, .sec-sub, .sd-title, .rtab b, .phil-grid .t, .compact .t, .rtable td a { text-wrap: balance; }
.note p, .note li { text-wrap: pretty; }
/* 머리 부분(디자인 B): 요약 카드 + 정보 표 */
.hd-sum { background: var(--c-soft, var(--teal-soft)); border-radius: 14px; padding: 16px 20px; margin: 14px 0 12px; }
.hd-sum > b { display: block; font-family: var(--f-display); font-weight: 700; color: var(--c, var(--teal)); font-size: .92rem; margin-bottom: 4px; }
.hd-sum p { margin: 0; line-height: 1.8; }
.hd-info { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 6px 16px; margin: 0 0 26px; padding: 10px 4px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .92rem; }
.hd-info dt { color: var(--muted); font-weight: 700; font-family: var(--f-display); }
.hd-info dd { margin: 0; }
@media (max-width: 560px) { .hd-info { grid-template-columns: 1fr; } .hd-info dt { margin-top: 6px; } }
/* ---- 페이지 색 10가지 (theme.js, html[data-theme]) ---- */
html[data-theme="forest"]   { --bg:#F3F7F2; --surface:#FFFFFF; --ink:#1E2A22; --muted:#66756A; --line:#DDE6DC; --line-soft:#E8EFE7; --gold:#3E6B48; --teal:#3E6B48; --teal-soft:#DCEBDD; --hero-muted:#3E6B48; }
html[data-theme="sunset"]   { --bg:#FBF5EF; --surface:#FFFFFF; --ink:#2E2420; --muted:#7A6A62; --line:#EFE2D8; --line-soft:#F5EBE3; --gold:#B4542E; --teal:#B4542E; --teal-soft:#F8E1D4; --hero-muted:#B4542E; }
html[data-theme="lavender"] { --bg:#F6F4FB; --surface:#FFFFFF; --ink:#24203A; --muted:#6F6A85; --line:#E4E0F0; --line-soft:#EDEAF6; --gold:#6A55A8; --teal:#6A55A8; --teal-soft:#E6E0F6; --hero-muted:#6A55A8; }
html[data-theme="sand"]     { --bg:#F7F2E8; --surface:#FFFDF8; --ink:#2F2A20; --muted:#7A705F; --line:#E8DFCC; --line-soft:#F0E9DA; --gold:#8A6A3B; --teal:#8A6A3B; --teal-soft:#F0E4CC; --hero-muted:#8A6A3B; --hero:#FFFDF8; }
html[data-theme="sea"]      { --bg:#F0F7F7; --surface:#FFFFFF; --ink:#1B2B2D; --muted:#5F7577; --line:#D9E8E8; --line-soft:#E5F0F0; --gold:#1F6E73; --teal:#1F6E73; --teal-soft:#D5ECEC; --hero-muted:#1F6E73; }
html[data-theme="blossom"]  { --bg:#FBF4F6; --surface:#FFFFFF; --ink:#2E2228; --muted:#7D6872; --line:#F0DFE5; --line-soft:#F6E9EE; --gold:#A84E6E; --teal:#A84E6E; --teal-soft:#F6DDE6; --hero-muted:#A84E6E; }
html[data-theme="ink"]      { --bg:#F5F5F4; --surface:#FFFFFF; --ink:#1C1C1C; --muted:#6B6B6B; --line:#E2E2E0; --line-soft:#ECECEA; --gold:#3A3A3A; --teal:#3A3A3A; --teal-soft:#E6E6E4; --hero-muted:#3A3A3A; }
html[data-theme="night"]    { --bg:#141A2A; --surface:#1C2438; --ink:#E6EAF4; --muted:#9AA4BC; --line:#2C3650; --line-soft:#252E45; --gold:#8FB3E8; --teal:#8FB3E8; --teal-soft:#24324F; --navy-soft:#2B2645; --olive-soft:#3A2A22; --amber-soft:#1E3530; --rose-soft:#3A2430; --hero:#1C2438; --hero-ink:#E6EAF4; --hero-muted:#8FB3E8; color-scheme: dark; }
html[data-theme="dark"]     { --bg:#18181A; --surface:#222226; --ink:#ECEAE4; --muted:#A4A09A; --line:#34343A; --line-soft:#2B2B30; --gold:#C9A86A; --teal:#C9A86A; --teal-soft:#3A3326; --navy-soft:#2E2A3A; --olive-soft:#3A2D22; --amber-soft:#22322D; --rose-soft:#3A2A30; --hero:#222226; --hero-ink:#ECEAE4; --hero-muted:#C9A86A; color-scheme: dark; }
html[data-theme="night"] .note blockquote.quote, html[data-theme="dark"] .note blockquote.quote { color: var(--ink); }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 10px 3px 6px; font: inherit; font-size: .85rem; cursor: pointer; }
.theme-btn .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); }
.theme-pop { position: fixed; top: 58px; right: 16px; z-index: 60; width: 236px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.theme-pop[hidden] { display: none; }
.theme-pop p { grid-column: 1 / -1; margin: 0 0 4px 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.theme-pop button { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: none; color: var(--ink); border-radius: 8px; padding: 6px; font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.theme-pop button:hover { background: var(--line-soft); }
.theme-pop button.on { border-color: var(--teal); }
.theme-pop .sw { width: 22px; height: 22px; border-radius: 6px; border: 2px solid; display: inline-flex; align-items: flex-end; justify-content: flex-end; overflow: hidden; flex: none; }
.theme-pop .sw i { width: 10px; height: 10px; border-radius: 3px 0 0 0; }

/* 철학자 얼굴 (위키미디어 공용 그림) */
.phil-grid a { position: relative; padding-left: 52px; min-height: 58px; justify-content: center; }
.phil-grid .face { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--line); }
.phil-grid .face.none { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; color: var(--teal); background: var(--surface); border: 1px solid var(--line); box-sizing: border-box; }
.portrait { float: right; margin: 0 0 12px 18px; width: 150px; text-align: center; }
.portrait img { width: 150px; height: 180px; object-fit: cover; object-position: 50% 15%; border-radius: 12px; border: 1px solid var(--line); background: var(--line); }
.portrait figcaption { font-size: .7rem; color: var(--muted); line-height: 1.35; margin-top: 4px; word-break: keep-all; }
.portrait figcaption a { color: inherit; }
@media (max-width: 600px) { .portrait { width: 104px; margin-left: 12px; } .portrait img { width: 104px; height: 124px; } }

/* 큰 묶음(1부·2부 …) 제목과 접히는 목차 */
.toc li.fold { display: none; }
article.note h2.part { margin-top: 2.6em; padding: .55em .8em; border-radius: 10px; background: var(--teal-soft); color: var(--teal); font-size: 1.25rem; }
article.note h2.part + h3 { margin-top: .9em; }

/* 출처 라벨: (슬라이드 57)·(pp. 12–14)·□ 출처 */
.ref { display: inline-block; margin: 0 1px; padding: 0 7px; border-radius: 999px; background: var(--line-soft, rgba(0,0,0,.05)); border: 1px solid var(--line); color: var(--muted); font-size: .74em; line-height: 1.55; vertical-align: .08em; white-space: nowrap; font-weight: 400; }
.ref.gen { border-style: dashed; background: transparent; }

/* 제목 아래 영어 한 줄 */
.h-en { display: block; margin-top: .25em; font-size: .6em; font-weight: 400; color: var(--muted); letter-spacing: 0; font-family: Georgia, "Times New Roman", serif; font-style: italic; line-height: 1.35; }
h2.part .h-en { color: inherit; opacity: .75; }

/* 긴 출처 설명은 라벨 대신 작은 글씨로 */
.src-note { color: var(--muted); font-size: .82em; font-weight: 400; }

/* 글 읽기 도구(read.js): 글자 크기 · 형광펜 · 밑줄 */
html { font-size: calc(100% * var(--rs, 1)); }
.rd-btn { padding: 3px 11px; } .rd-btn b { font-family: var(--f-display); }
.rd-pop { grid-template-columns: 1fr; }
.rd-float { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 16px; z-index: 55; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.14); display: inline-flex; align-items: center; justify-content: center; }
.rd-float b { font-family: var(--f-display); }
.rd-float[hidden] { display: none; }
html[data-eink="1"] .rd-float { border: 2px solid #000; }
.rd-size { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 6px; }
.rd-size button, .rd-mode { justify-content: center; border: 1px solid var(--line) !important; }
.rd-mark { color: inherit; border-radius: 2px; padding: 0 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rd-y { background: rgba(255, 221, 64, .55); } .rd-g { background: rgba(140, 220, 110, .5); } .rd-p { background: rgba(255, 150, 190, .5); }
.rd-u { background: none; text-decoration: underline; text-decoration-color: #E0533D; text-decoration-thickness: 2px; text-underline-offset: 3px; padding: 0; }
html[data-theme="night"] .rd-y, html[data-theme="dark"] .rd-y { background: rgba(255, 210, 60, .35); }
html[data-theme="night"] .rd-g, html[data-theme="dark"] .rd-g { background: rgba(120, 210, 100, .32); }
html[data-theme="night"] .rd-p, html[data-theme="dark"] .rd-p { background: rgba(255, 130, 180, .32); }
.rd-bar { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; box-shadow: 0 8px 28px rgba(0,0,0,.2); font-size: 15px; }
.rd-bar[hidden] { display: none; }
.rd-bar button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 9px; padding: 8px 12px; font: inherit; cursor: pointer; min-height: 40px; -webkit-user-select: none; user-select: none; }
.rd-bar .rd-off { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.rd-sw { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.rd-tip { color: var(--muted); font-size: 13px; } .rd-st { color: var(--muted); font-size: 12px; min-width: 0; }
body.rd-on { padding-bottom: 90px; }
@media (max-width: 600px) { .rd-tip { display: none; } .rd-bar button { padding: 7px 9px; } }

/* 왼쪽 목록 접기(read.js) */
.side-fold { display: block; margin: 0 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.side-open { display: none; margin: 0 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.shell.with-side.side-off { max-width: 1180px; grid-template-columns: minmax(0, 1fr); }
.shell.with-side.side-off > .side { display: none; }
.shell.side-off .side-open { display: inline-block; }
@media (min-width: 1240px) { .shell.with-side.with-toc.side-off { max-width: 1100px; grid-template-columns: minmax(0, 1fr) 210px; } }
@media (max-width: 820px) { .shell.with-side.side-off { max-width: 820px; } }

/* 읽기 모드(컬러 전자잉크용, read.js): 흰 바탕·검은 글자, 그림자·움직임 없음, 옆 목록 숨김, 쪽 넘기기 단추. 색은 살리되 진하게 */
.rd-page { display: none; }
html[data-eink="1"][data-eink] { --bg:#FFFFFF; --surface:#FFFFFF; --ink:#000000; --muted:#333333; --line:#555555; --line-soft:#E6E6E6; --hero:#FFFFFF; --hero-ink:#000000; --hero-muted:#333333; color-scheme: light; scroll-behavior: auto; }
html[data-eink="1"] *, html[data-eink="1"] *::before, html[data-eink="1"] *::after { box-shadow: none !important; text-shadow: none !important; transition: none !important; animation: none !important; }
html[data-eink="1"] body { background: #FFFFFF; color: #000000; }
html[data-eink="1"] .shell.with-side, html[data-eink="1"] .shell.with-toc, html[data-eink="1"] .shell.with-side.with-toc { display: block; max-width: 760px; }
html[data-eink="1"] .shell > .side, html[data-eink="1"] .toc, html[data-eink="1"] .toc-btn, html[data-eink="1"] .side-open, html[data-eink="1"] .theme-btn:not(.rd-btn), html[data-eink="1"] .cats { display: none !important; }
html[data-eink="1"] .diagram svg, html[data-eink="1"] .sd, html[data-eink="1"] .note img { filter: saturate(1.6) contrast(1.1); }
html[data-eink="1"] .rd-y { background: rgba(255, 210, 0, .85); }
html[data-eink="1"] .rd-g { background: rgba(60, 200, 60, .7); }
html[data-eink="1"] .rd-p { background: rgba(255, 90, 160, .65); }
html[data-eink="1"] .rd-u { text-decoration-thickness: 3px; text-decoration-color: #E00000; }
html[data-eink="1"] .rd-page { display: flex; flex-direction: column; gap: 10px; position: fixed; right: 10px; bottom: 90px; z-index: 65; }
html[data-eink="1"] .rd-page button { width: 54px; height: 54px; border: 2px solid #000; background: #FFF; color: #000; border-radius: 10px; font-size: 22px; cursor: pointer; }

/* ---- 글 읽으며 묻기(제미나이) 대화창: 넓은 화면은 오른쪽, 좁은 화면은 아래에서 올라온다 ---- */
.ask-panel { position: fixed; z-index: 80; right: 16px; top: 72px; bottom: 16px; width: min(400px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(20, 24, 40, .18); font-family: var(--f-body); }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.ask-head b { font-size: 1rem; }
.ask-by { font-size: .75rem; color: var(--muted); margin-right: auto; }
.ask-head button, .ask-row button, .ask-quote button { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.ask-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: .95rem; line-height: 1.65; }
.ask-empty { color: var(--muted); font-size: .9rem; margin: 0; }
.ask-msg { padding: 9px 12px; border-radius: 12px; max-width: 92%; word-break: keep-all; overflow-wrap: anywhere; }
.ask-u { align-self: flex-end; background: var(--teal-soft); }
.ask-m { align-self: flex-start; background: var(--bg); border: 1px solid var(--line-soft); }
.ask-wait { color: var(--muted); }
.ask-li { display: inline; }
.ask-msg blockquote { margin: 0 0 6px; padding: 4px 8px; border-left: 3px solid var(--gold); font-size: .85rem; color: var(--muted); max-height: 6.5em; overflow: hidden; }
.ask-quote { display: flex; gap: 6px; align-items: flex-start; margin: 0 12px; padding: 6px 8px; border-left: 3px solid var(--gold); background: var(--bg); font-size: .82rem; color: var(--muted); }
.ask-quote[hidden] { display: none; }
.ask-quote span { flex: 1; max-height: 4.8em; overflow: hidden; }
.ask-form { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.ask-form textarea { font: inherit; font-size: .95rem; width: 100%; box-sizing: border-box; resize: vertical; min-height: 3.2em; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); color: var(--ink); }
.ask-row { display: flex; gap: 8px; justify-content: flex-end; }
.ask-send { background: var(--gold) !important; color: #fff !important; border-color: var(--gold) !important; }
.ask-send:disabled { opacity: .5; }
@media (min-width: 1100px) { body.ask-on .shell { margin-right: 420px; } }
@media (max-width: 720px) { .ask-panel { left: 8px; right: 8px; top: auto; width: auto; height: 62vh; bottom: 8px; } }
html[data-eink="1"] .ask-panel { border: 2px solid #000; }
html[data-eink="1"] .ask-u { background: #EEEEEE; }
html[data-eink="1"] .ask-send { background: #000 !important; border-color: #000 !important; }

/* ---- 읽어 주기 ---- */
.tts-bar { position: fixed; z-index: 75; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  max-width: calc(100vw - 24px); padding: 8px 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(20, 24, 40, .16); font-family: var(--f-body); }
.tts-bar[hidden] { display: none; }
.tts-bar button { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 10px; cursor: pointer; min-height: 36px; }
.tts-bar .tts-play { background: var(--gold); color: #fff; border-color: var(--gold); }
.tts-pos { font-size: .8rem; color: var(--muted); min-width: 4.5em; text-align: center; }
body.rd-on .tts-bar { bottom: 84px; }
.rd-speaking { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; background: color-mix(in srgb, var(--teal-soft) 55%, transparent); }
html[data-eink="1"] .tts-bar { border: 2px solid #000; }
html[data-eink="1"] .tts-bar .tts-play { background: #000; border-color: #000; }
html[data-eink="1"] .rd-speaking { outline: 3px solid #000; background: none; }

/* 강의 내용 상자는 프리텐다드(본문 고운돋움과 구분), 한 줄 요약은 고운바탕 */
.note blockquote.lecture { font-family: var(--f-quote); font-size: .95em; line-height: 1.75; letter-spacing: -.01em; }
.hd-sum { font-family: var(--f-display); }

/* ---- 영어 용어 카드(/private/terms.html) ---- */
.tc { max-width: 560px; margin: 0 auto; padding: 8px 0 40px; font-family: var(--f-body); }
.tc h1 { font-size: 1.6rem; margin: 6px 0 4px; }
.tc-sub, .tc-tip { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.tc-tip { margin-top: 18px; font-size: .82rem; }
.tc-bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-bottom: 18px; }
.tc-bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.tc-lbl { font-size: .82rem; color: var(--muted); margin: 14px 0 6px; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc button { font: inherit; color: var(--ink); cursor: pointer; }
.tc-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; }
.tc-chip.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.tc-modes { display: flex; flex-direction: column; gap: 8px; }
.tc-modes button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .98rem; display: flex; justify-content: space-between; }
.tc-modes button span { color: var(--muted); font-size: .85rem; }
.tc-top { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.tc-top button { border: 0; background: none; color: var(--gold); padding: 6px 0; }
.tc-card { min-height: 52vh; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; box-shadow: 0 6px 22px rgba(20, 24, 40, .06); }
.tc-card.back { justify-content: flex-start; align-items: stretch; text-align: left; }
.tc-en { font-size: 1.9rem; font-weight: 700; line-height: 1.3; margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; }
.tc-en2 { font-size: 1rem; color: var(--muted); margin: 0 0 6px; font-family: Georgia, serif; }
.tc-ko { font-size: 1.45rem; font-weight: 700; margin: 0 0 6px; font-family: var(--f-display); }
.tc-mean { color: var(--ink); opacity: .85; margin: 0 0 14px; line-height: 1.65; }
.tc-ex { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; margin: 0 0 16px; }
.tc-ex p { margin: 0 0 6px; font-family: Georgia, serif; line-height: 1.6; }
.tc-ex b { color: var(--gold); }
.tc-ex .tc-exk { font-family: var(--f-body); color: var(--muted); font-size: .92rem; }
.tc-src { margin-top: auto; font-size: .85rem; color: var(--gold); text-decoration: none; }
.tc-say { border: 0; background: none; font-size: 1.1rem; padding: 4px 6px; }
.tc-hint { color: var(--muted); font-size: .82rem; margin: 18px 0 0; }
.tc-acts { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.tc-acts button { padding: 11px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .92rem; }
.tc-acts .tc-ok { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); font-weight: 700; }
.tc-acts .tc-prev, .tc-acts .tc-next { border: 0; background: none; color: var(--muted); }
.tc-acts .tc-next { grid-column: 4; }
.tc-q { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--surface); color: var(--ink); }
.tc-row { border-bottom: 1px solid var(--line-soft); padding: 10px 2px; }
.tc-row summary { cursor: pointer; }
.tc-row summary span { color: var(--muted); margin-left: 6px; }
.tc-row.ok summary b::after { content: " ✓"; color: var(--amber); }
.tc-row p { margin: 8px 0 0; line-height: 1.6; }
.tc-row a { color: var(--gold); text-decoration: none; font-size: .88rem; }
html[data-eink="1"] .tc-card { border: 2px solid #000; box-shadow: none; }
html[data-eink="1"] .tc-acts .tc-ok { background: #000; color: #fff; border-color: #000; }
