/* ==========================================================================
   웰쉐어 사회적협동조합 (coop.wssc.or.kr / wssc.co.kr)
   국보급 조선 고서·고화 서첩 (古書·古畵 書帖 — 『웰쉐어 보감(寶鑑)』)
   [가독성 특화 판본 v8]
   - "까만 건 글씨구나" 느낌 완전 타파! 눈이 시원하고 핵심이 한눈에 꽂히는 초선명 고서 조판
   - 밝고 기품 있는 궁중 백첩 한지(白貼 韓紙) 본문면 + 진한 송연묵(AAA급 명암 대비 14:1)
   - 핵심 어휘(strong) 주칠 형광 밑줄 + 연도·조목 주칠 인장 배지 + 넉넉한 글자 크기(17.5px)와 굵은 필획
   - 상시 고정 비단 서표 메뉴바 & 우측/하단 목간 리모컨 & 좌우 대칭 2열 서첩 그리드
   ========================================================================== */

:root {
  /* 서안(書案 · 어두운 옻칠 고가구 바탕 — 책장 외곽 여백) */
  --sanctuary-dark: #18120c;
  --sanctuary-wood: #241b13;

  /* 300년 고서 외곽 한지 + 눈이 부시지 않으면서 글씨가 쨍하게 살아나는 궁중 백첩 한지(본문면) */
  --hanji-base: #f2e7cf;
  --hanji-light: #fbf6eb;
  --hanji-paper-card: rgba(252, 248, 238, 0.92);
  --hanji-deep: #e2d0ad;
  --hanji-silk: #d5be93;
  --hanji-wash: rgba(210, 184, 138, 0.25);

  /* 송연묵(松煙墨 · 선명하고 진한 먹색 — 흐릿한 회갈색 추방, 가독성 극대화!) */
  --ink-sumi: #120c06;
  --ink-body: #1e150c;
  --ink-faded: #3b2a1a;
  --ink-muted: #59432d;

  /* 전통 천연 석채(石彩) 안료 — 선명한 경면주사 주칠 · 노송 석록 · 황금니 */
  --cinnabar-red: #9e2116;
  --cinnabar-bright: #b8281b;
  --cinnabar-soft: rgba(158, 33, 22, 0.12);
  --cinnabar-line: rgba(158, 33, 22, 0.42);
  --pine-mineral: #26422b;
  --ochre-gold: #7d5622;

  /* 서체 — 표제는 묵직한 목판본(Song Myung), 본문은 획이 굵고 선명한 본명조(Noto Serif KR) 우선! */
  --font-woodblock: "Song Myung", "Noto Serif KR", "Batang", serif;
  --font-serif: "Noto Serif KR", "Gowun Batang", "Nanum Myeongjo", "Batang", serif;

  --folio-max: 1260px;
  --font-scale: 1;
}

/* 야독(황촉 눈편한) 모드 */
body.candle-mode {
  --hanji-base: #e5d4b3;
  --hanji-light: #efe2c6;
  --hanji-paper-card: rgba(242, 229, 202, 0.94);
  --ink-sumi: #181008;
  --ink-body: #24190e;
  --ink-faded: #42301e;
}

html[data-font-scale="lg"] {
  --font-scale: 1.09;
}
html[data-font-scale="xl"] {
  --font-scale: 1.18;
}

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

html {
  /* 기본 글자 크기를 17px로 키워 눈이 시원하게 읽히도록 설정 */
  font-size: calc(17px * var(--font-scale));
  scroll-behavior: smooth;
  overflow-x: clip;
  background-color: var(--sanctuary-dark);
}

body {
  margin: 0;
  padding: 5.8rem 1.2rem 3.8rem;
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink-body);
  line-height: 1.92;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--sanctuary-dark);
  background-image:
    radial-gradient(ellipse at 50% 12%, rgba(102, 72, 40, 0.38) 0%, transparent 65%),
    radial-gradient(ellipse at 50% 88%, rgba(76, 52, 28, 0.3) 0%, transparent 65%);
}

::selection {
  background: rgba(158, 33, 22, 0.22);
  color: var(--ink-sumi);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.22s ease, background-color 0.22s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 본문 내 강조 어휘(strong)에 주칠·금니 형광 밑줄을 깔아 눈으로 훑어도 핵심이 바로 들어오게 함! */
p strong,
li strong,
td strong,
.codex-scroll-sheet strong {
  color: var(--ink-sumi);
  font-weight: 700;
  background: linear-gradient(180deg, transparent 62%, rgba(184, 40, 27, 0.16) 62%);
  padding: 0 0.12rem;
  border-radius: 2px;
}

/* 모든 섹션 앵커 이동 시 상단 고정 메뉴바에 제목이 가려지지 않도록 여백 확보 */
section[id] {
  scroll-margin-top: 6.4rem;
}

/* ==========================================================================
   1. 상시 고정 고서 비단 서표 메뉴바 (#sticky-codex-nav)
   스크롤 내릴 때도 항상 상단에 붙어 있어 어느 권이든 즉시 이동 & 9개 전 메뉴 100% 표시
   ========================================================================== */
.sticky-codex-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 950;
  background: rgba(32, 22, 14, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #8c5e32;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

.sticky-codex-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0.38rem 1.2rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.sticky-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sticky-brand-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-woodblock);
  font-size: 1.02rem;
  color: #fbf3e2;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.sticky-brand-seal img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sticky-chapter-links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem 0.38rem;
  padding-top: 0.22rem;
  border-top: 1px solid rgba(212, 178, 126, 0.22);
}

.sticky-chap-link {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: #f4e6ce;
  background: rgba(255, 246, 228, 0.09);
  padding: 0.25rem 0.68rem;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(212, 178, 126, 0.28);
  transition: all 0.2s ease;
}

.sticky-chap-link:hover,
.sticky-chap-link.active {
  color: #fff9ee;
  background: var(--cinnabar-red);
  border-color: #f0a899;
  box-shadow: 0 2px 8px rgba(158, 33, 22, 0.45);
}

.sticky-utility-btns {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.sticky-utility-btns .woodblock-slip-btn {
  background: rgba(251, 246, 235, 0.94);
  color: var(--ink-sumi);
  font-size: 0.75rem;
  padding: 0.22rem 0.52rem;
}

.sticky-reading-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.sticky-reading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #d4893b, #c92a1d);
  transition: width 0.12s linear;
}

/* ==========================================================================
   2. 우측/하단 상시 유동 목간(木簡) 리모컨 (#floating-codex-dock)
   ========================================================================== */
.floating-codex-dock {
  position: fixed;
  right: 1rem;
  bottom: 1.2rem;
  z-index: 920;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding: 0.55rem 0.45rem;
  background: rgba(34, 23, 14, 0.94);
  border: 1.5px solid #96683a;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.dock-slip-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.76rem;
  font-weight: 700;
  color: #f7ead2;
  background: rgba(255, 246, 228, 0.1);
  border: 1px solid rgba(212, 178, 126, 0.35);
  border-radius: 4px;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dock-slip-btn:hover,
.dock-slip-btn.accent {
  background: var(--cinnabar-red);
  color: #fff;
  border-color: #f0a899;
}

.dock-divider {
  height: 1px;
  background: rgba(212, 178, 126, 0.3);
  margin: 0.15rem 0;
}

/* ==========================================================================
   3. 고서 책장 대지 (The Sacred Folio — 선명한 백첩 한지 + 오침안정법 제본)
   ========================================================================== */
.ancient-codex-folio {
  position: relative;
  max-width: var(--folio-max);
  margin: 0 auto;
  background-color: var(--hanji-base);
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(255, 252, 245, 0.72) 0%, transparent 68%),
    url("/assets/art/hanji_aged_patina.png");
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, 480px 480px;
  border-radius: 4px 10px 10px 4px;
  box-shadow:
    inset 0 0 85px rgba(98, 64, 28, 0.25),
    inset -20px 0 32px rgba(64, 40, 16, 0.18),
    0 24px 64px rgba(0, 0, 0, 0.78);
  padding: 2.2rem 3.2rem 3.4rem 2.6rem;
  overflow: hidden;
}

/* 우측 오침안정법(五針眼訂法 · 조선 고서 삼베실 5구멍 제본선) */
.ancient-codex-folio::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 22px;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(82, 52, 24, 0.32) 0%, rgba(42, 26, 12, 0.1) 25%, rgba(216, 192, 152, 0.25) 100%),
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      transparent 140px,
      rgba(248, 240, 222, 0.9) 140px,
      rgba(248, 240, 222, 0.9) 146px,
      transparent 146px,
      transparent 220px
    );
  border-left: 1.5px solid rgba(92, 60, 28, 0.42);
}

/* 고서 내부 사주쌍변(四周雙邊 · 또렷한 주칠·먹 이중 내곽선) */
.codex-inner-frame {
  position: relative;
  z-index: 1;
  padding: 1.6rem 2rem;
  border: 1.5px solid rgba(102, 66, 32, 0.42);
  box-shadow: inset 0 0 0 4px var(--hanji-base), inset 0 0 0 5.5px rgba(158, 33, 22, 0.32);
  border-radius: 4px;
}

/* ==========================================================================
   4. 상단 서지란 & 목판 패(木版 牌) 버튼 — 글씨 또렷하게!
   ========================================================================== */
.codex-marginalia-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.3rem;
  border-bottom: 1.5px solid rgba(112, 76, 40, 0.32);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-faded);
}

.marginalia-imprint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* 주칠 인장 배지 — 글씨가 한눈에 튀어나오도록 선명한 대비 적용 */
.cinnabar-seal-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  color: #fff9f0;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--cinnabar-red);
  border: 1px solid #7a160d;
  border-radius: 3px;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 4px rgba(158, 33, 22, 0.25);
}

.marginalia-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.woodblock-slip-btn {
  appearance: none;
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-sumi);
  background: var(--hanji-light);
  border: 1.5px solid rgba(110, 74, 38, 0.48);
  border-radius: 4px;
  padding: 0.3rem 0.72rem;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(42, 26, 12, 0.08);
  transition: all 0.2s ease;
}

.woodblock-slip-btn:hover,
.woodblock-slip-btn.active {
  color: #fff9f0 !important;
  background: var(--cinnabar-red);
  border-color: var(--cinnabar-red);
  box-shadow: 0 3px 8px rgba(158, 33, 22, 0.28);
}

/* ==========================================================================
   5. 권수(卷首) 표제부 & 빠른 실무 편의 회랑 & 비단 서표 목차
   ========================================================================== */
.codex-title-shrine {
  text-align: center;
  padding: 0.6rem 0.5rem 1.4rem;
}

.jechum-logo-plaque {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.6rem 1.5rem;
  margin-bottom: 0.75rem;
  background: var(--hanji-light);
  border: 1px solid rgba(128, 88, 48, 0.35);
  border-radius: 40px;
  box-shadow: 0 4px 14px rgba(58, 36, 14, 0.1);
}

.jechum-logo-plaque img.ci-main-logo {
  height: 48px;
  width: auto;
}

.codex-main-heading {
  font-family: var(--font-woodblock);
  font-size: clamp(2.1rem, 4.3vw, 3.35rem);
  font-weight: 400;
  color: var(--ink-sumi);
  letter-spacing: 0.1em;
  margin: 0.15rem 0 0.5rem;
  line-height: 1.25;
  text-shadow: 0 2px 0 rgba(255, 252, 245, 0.9);
}

.codex-sub-colophon {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink-body);
  letter-spacing: 0.02em;
  margin: 0 auto 0.9rem;
  max-width: 72ch;
}

.quick-convenience-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin: 0.95rem auto 0.6rem;
}

.silk-bookmark-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 1rem auto 1.2rem;
  padding: 0.75rem 1rem;
  background: rgba(252, 247, 236, 0.85);
  border-top: 1.5px solid rgba(122, 82, 42, 0.35);
  border-bottom: 1.5px solid rgba(122, 82, 42, 0.35);
  border-radius: 4px;
}

.silk-bookmark-link {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.36rem 0.78rem;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-sumi);
  border-radius: 4px;
  white-space: nowrap;
}

.silk-bookmark-link::before {
  content: "◈";
  font-size: 0.72rem;
  color: var(--cinnabar-red);
}

.silk-bookmark-link:hover,
.silk-bookmark-link.active {
  color: #fff9f0;
  background: var(--cinnabar-red);
}
.silk-bookmark-link:hover::before,
.silk-bookmark-link.active::before {
  color: #fff9f0;
}

/* ==========================================================================
   6. 권두 고화(古畵) 화첩 병풍 스테이지
   ========================================================================== */
.ancient-painting-album {
  position: relative;
  margin: 0.5rem 0 2.2rem;
  padding: 1.25rem;
  background: rgba(247, 238, 218, 0.9);
  border: 1.5px solid rgba(118, 80, 42, 0.38);
  border-radius: 6px;
  box-shadow:
    inset 0 0 32px rgba(88, 56, 24, 0.16),
    0 8px 24px rgba(42, 26, 12, 0.12);
}

.painting-scroll-frame {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #d8c39e;
  border: 1px solid rgba(98, 64, 30, 0.45);
}

.painting-scroll-img {
  width: 100%;
  height: clamp(260px, 43vw, 460px);
  object-fit: cover;
  object-position: center;
  filter: sepia(0.12) contrast(1.04) brightness(0.98);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
  cursor: pointer;
}

.painting-scroll-frame:hover .painting-scroll-img {
  transform: scale(1.015);
  filter: sepia(0.03) contrast(1.06) brightness(1);
}

.painting-vertical-colophon {
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: upright;
  background: rgba(252, 247, 235, 0.95);
  padding: 0.8rem 0.55rem;
  font-family: var(--font-woodblock);
  font-size: 0.95rem;
  color: var(--ink-sumi);
  letter-spacing: 0.16em;
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(122, 84, 44, 0.55);
}

.painting-collector-seals {
  position: absolute;
  bottom: 1rem;
  left: 1.15rem;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.painting-collector-seals img.real-seal-stamp {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: rgba(252, 246, 234, 0.85);
  padding: 3px;
  border-radius: 3px;
}

.carved-cinnabar-seal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.48rem;
  background: var(--cinnabar-red);
  color: #fff9f0;
  font-family: var(--font-woodblock);
  font-size: 0.74rem;
  line-height: 1.18;
  letter-spacing: 0.08em;
  border: 1.5px solid #f7ebd2;
  outline: 2px solid var(--cinnabar-red);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.painting-album-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
}

.painting-caption-prose {
  flex: 1 1 420px;
}

.painting-caption-stamp {
  font-family: var(--font-woodblock);
  font-size: 1.15rem;
  color: var(--cinnabar-red);
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.painting-caption-sub {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink-body);
  margin: 0;
}

.painting-folio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ==========================================================================
   7. 어람 실록 총기(御覽 實錄 總記) — 반원 계기판 도표 대신 주칠 어보 4폭 족자
   ========================================================================== */
.chronicle-royal-overview {
  margin: 1.6rem 0 2.4rem;
  padding: 1.6rem 1.8rem;
  background: var(--hanji-paper-card);
  border: 1.5px solid rgba(118, 78, 40, 0.42);
  border-left: 5px solid var(--cinnabar-red);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(48, 30, 12, 0.08);
}

.chronicle-overview-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px dashed rgba(118, 78, 40, 0.35);
}

.chronicle-eulogy-box {
  margin: 1.1rem 0 1.3rem;
  padding: 1.1rem 1.35rem;
  background: rgba(243, 232, 208, 0.65);
  border-radius: 4px;
  border: 1px solid rgba(148, 41, 32, 0.25);
}

.chronicle-seal-scrolls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.chronicle-seal-scroll-card {
  position: relative;
  padding: 1.15rem 1rem 1.1rem;
  background: #fdfaf3;
  border: 1.5px solid rgba(118, 78, 40, 0.42);
  border-top: 4px solid var(--cinnabar-red);
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(42, 26, 12, 0.06);
}

.scroll-cinnabar-stamp {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  font-family: var(--font-woodblock);
  font-size: 0.78rem;
  color: var(--cinnabar-red);
  background: rgba(158, 33, 22, 0.09);
  border: 1.5px solid rgba(158, 33, 22, 0.5);
  border-radius: 2px;
  letter-spacing: 0.12em;
  margin-bottom: 0.4rem;
}

.scroll-hanja-kicker {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-faded);
  margin-bottom: 0.2rem;
}

.scroll-main-figure {
  font-family: var(--font-woodblock);
  font-size: 1.55rem;
  color: var(--ink-sumi);
  line-height: 1.25;
  margin: 0.15rem 0 0.25rem;
}

.scroll-sub-note {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cinnabar-red);
}

/* ==========================================================================
   8. 판심 어미(魚尾) 구분선 & 권(卷) 표제 헤더 (선명한 대비!)
   ========================================================================== */
.woodblock-fishtail-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 2.8rem 0 2.2rem;
  color: var(--cinnabar-red);
  font-family: var(--font-woodblock);
  font-size: 0.98rem;
  letter-spacing: 0.16em;
}

.woodblock-fishtail-divider::before,
.woodblock-fishtail-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(112, 76, 40, 0.45) 30%,
    var(--cinnabar-red) 80%
  );
}

.woodblock-fishtail-divider::after {
  background: linear-gradient(
    90deg,
    var(--cinnabar-red) 20%,
    rgba(112, 76, 40, 0.45) 70%,
    transparent
  );
}

.chapter-title-block {
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 820px;
}

.chapter-volume-seal {
  display: inline-block;
  font-family: var(--font-woodblock);
  font-size: 0.95rem;
  color: #fff9f0;
  background: var(--cinnabar-red);
  letter-spacing: 0.12em;
  padding: 0.22rem 0.95rem;
  margin-bottom: 0.55rem;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(158, 33, 22, 0.28);
}

.chapter-heading {
  font-family: var(--font-woodblock);
  font-size: clamp(1.65rem, 3.1vw, 2.35rem);
  font-weight: 400;
  color: var(--ink-sumi);
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
  line-height: 1.34;
}

.chapter-lead {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-faded);
  margin: 0;
  line-height: 1.75;
}

/* ==========================================================================
   9. 좌우 2단 서첩 & 본문 한지 시트 (백첩 한지 바탕으로 글자 가독성 극대화!)
   ========================================================================== */
.codex-two-folio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
  align-items: stretch;
}

.codex-scroll-sheet {
  padding: 1.65rem 1.8rem;
  background: var(--hanji-paper-card);
  border: 1.5px solid rgba(118, 78, 40, 0.38);
  border-radius: 6px;
  box-shadow:
    inset 0 0 24px rgba(138, 96, 48, 0.08),
    0 4px 16px rgba(42, 26, 12, 0.06);
}

.codex-dropcap-p::first-letter {
  float: left;
  font-family: var(--font-woodblock);
  font-size: 3rem;
  line-height: 0.95;
  padding: 0.18rem 0.55rem 0.15rem 0.15rem;
  margin-right: 0.35rem;
  color: var(--cinnabar-red);
}

.codex-poem-quote {
  margin: 1.2rem 0;
  padding: 1rem 1.3rem;
  background: rgba(242, 228, 198, 0.72);
  border-left: 4px solid var(--cinnabar-red);
  font-family: var(--font-woodblock);
  font-size: 1.08rem;
  color: var(--ink-sumi);
  line-height: 1.78;
  border-radius: 0 4px 4px 0;
}

/* 6대 사업 · 8대 연대 실록 — 선명한 백첩 한지 조목 카드 */
.codex-clauses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.6rem;
  margin-top: 1.6rem;
}

.codex-clause-entry {
  position: relative;
  padding: 1.15rem 1.35rem;
  background: var(--hanji-paper-card);
  border: 1.5px solid rgba(118, 78, 40, 0.36);
  border-left: 4px solid var(--cinnabar-red);
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(42, 26, 12, 0.05);
}

.clause-hanja-num {
  font-family: var(--font-woodblock);
  font-size: 0.9rem;
  color: var(--cinnabar-red);
  letter-spacing: 0.06em;
}

.clause-title {
  font-family: var(--font-woodblock);
  font-size: 1.26rem;
  font-weight: 400;
  color: var(--ink-sumi);
  margin: 0.25rem 0 0.45rem;
  line-height: 1.35;
}

.clause-desc {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink-body);
  margin: 0;
  line-height: 1.8;
}

/* 10대 연대 기관 방목 2열 그리드 */
.partner-alliance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
}

.partner-scroll-item {
  padding: 0.85rem 1.1rem;
  background: var(--hanji-paper-card);
  border: 1px solid rgba(118, 78, 40, 0.36);
  border-radius: 5px;
}

/* ==========================================================================
   10. 제2권 · 편년 연보 · 포상 교지 · 최신 보도 특집 슬립
   ========================================================================== */
.award-royal-edict {
  margin: 0.95rem 0;
  padding: 0.95rem 1.15rem;
  background: rgba(255, 248, 236, 0.92);
  border: 1.5px solid rgba(158, 33, 22, 0.38);
  border-left: 4px solid var(--cinnabar-red);
  border-radius: 4px;
}

.chronicle-brush-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.chronicle-brush-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(112, 76, 40, 0.32);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-body);
  align-items: baseline;
}

.chronicle-year-seal {
  display: inline-block;
  font-family: var(--font-woodblock);
  font-size: 0.88rem;
  color: var(--cinnabar-red);
  background: rgba(158, 33, 22, 0.09);
  border: 1px solid rgba(158, 33, 22, 0.32);
  padding: 0.08rem 0.42rem;
  border-radius: 3px;
  text-align: center;
}

.press-highlight-slip {
  padding: 0.75rem 0.95rem;
  background: #fdfaf3;
  border: 1px solid rgba(118, 78, 40, 0.38);
  border-left: 3.5px solid var(--cinnabar-red);
  border-radius: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.press-highlight-slip:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(158, 33, 22, 0.14);
}

/* 시공 전후 사진 화첩 배접 */
.csr-album-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 1rem;
}

.csr-album-leaf {
  margin: 0;
  padding: 0.6rem;
  background: #fdfaf3;
  border: 1px solid rgba(118, 78, 40, 0.38);
  border-radius: 4px;
  cursor: pointer;
}

.csr-album-leaf img {
  width: 100%;
  height: 162px;
  object-fit: cover;
  border-radius: 2px;
  transition: transform 0.35s ease;
}

.csr-album-leaf:hover img {
  transform: scale(1.02);
}

.csr-album-leaf figcaption {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-sumi);
  text-align: center;
  padding-top: 0.45rem;
}

/* ==========================================================================
   11. 제3권 · 경기 이십이읍 3D 입체 대동여지도 & 권역 읍지록 (좌우 상하 끝선 100% 일치)
   ========================================================================== */
.daedong-map-stage {
  padding: 1.45rem 1.55rem;
  background: var(--hanji-paper-card);
  border: 1.5px solid rgba(118, 78, 40, 0.38);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.95rem;
  height: 100%;
  box-shadow:
    inset 0 0 24px rgba(138, 96, 48, 0.08),
    0 4px 16px rgba(42, 26, 12, 0.06);
}

.map-3d-stage-box {
  position: relative;
  border: 2px solid #754e28;
  border-radius: 6px;
  background: #070d17;
  box-shadow:
    inset 0 0 36px rgba(8, 16, 28, 0.72),
    0 10px 24px rgba(28, 16, 6, 0.28);
  overflow: hidden;
}

.map3d-webgl-stage {
  position: relative;
  width: 100%;
  height: 550px;
  background: radial-gradient(ellipse at 50% 42%, #0d1b30 0%, #070d17 100%);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.map3d-webgl-stage:active {
  cursor: grabbing;
}

.loc3d-webgl-stage {
  position: relative;
  width: 100%;
  height: 440px;
  background: radial-gradient(ellipse at 50% 40%, #0d1d34 0%, #070d17 100%);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.loc3d-webgl-stage:active {
  cursor: grabbing;
}

.map3d-webgl-stage canvas,
.loc3d-webgl-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Three.js 3D 오버레이 태그 레이어 (웰쉐어로지스 map3d/location3d 완벽 호환) */
.map3d-tags {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.map3d-tags > span,
.map3d-tag {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  color: #eaf6ff;
  background: rgba(10, 20, 40, 0.84);
  border: 1px solid rgba(95, 211, 255, 0.55);
  padding: 0.14rem 0.46rem;
  border-radius: 999px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.map3d-tags > span:hover,
.map3d-tag:hover,
.map3d-tags > span.hi,
.map3d-tag.hi {
  color: #fffbeb;
  background: rgba(217, 119, 6, 0.95);
  border-color: #fde68a;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.65);
  z-index: 7;
}

.map3d-tags > span.hq,
.map3d-hq {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  cursor: pointer;
  background: linear-gradient(135deg, #e03131, #9e1b12);
  color: #fff9eb;
  border: 1.5px solid #ffd166;
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 16px rgba(251, 191, 36, 0.55);
  white-space: nowrap;
  z-index: 8;
}

.map3d-tags > span.cap,
.map3d-inset-cap {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  font-family: var(--font-woodblock);
  font-size: 0.78rem;
  color: #7dd3fc;
  background: rgba(8, 18, 36, 0.88);
  border: 1px solid rgba(95, 211, 255, 0.48);
  padding: 0.16rem 0.58rem;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 5;
}

.map3d-tip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 12;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(9, 16, 29, 0.95);
  color: #fef3c7;
  border: 1.5px solid #fbbf24;
  border-radius: 6px;
  padding: 0.35rem 0.68rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.map3d-tip.on {
  opacity: 1;
}

/* 권말 3D 스마트타운 & OSRM 길안내 오버레이 태그 */
.loc-hq {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 58, 138, 0.92));
  border: 1.5px solid #fbbf24;
  color: #fff;
  padding: 0.28rem 0.68rem;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7), 0 0 18px rgba(251, 191, 36, 0.4);
  white-space: nowrap;
  z-index: 9;
}

.loc-hq span {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: #fde68a;
  font-weight: 800;
}

.loc-hq b {
  font-family: var(--font-woodblock);
  font-size: 0.86rem;
  font-weight: 400;
  color: #ffffff !important;
}

.loc-hq small {
  font-size: 0.66rem;
  color: #bae6fd;
}

.loc-ic {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(12, 24, 44, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #e2e8f0;
  padding: 0.2rem 0.52rem;
  border-radius: 6px;
  font-family: var(--font-serif);
  white-space: nowrap;
  transition: all 0.18s ease;
  z-index: 7;
}

.loc-ic b {
  font-size: 0.74rem;
  color: #ffffff !important;
}

.loc-ic small {
  font-size: 0.62rem;
  color: #93c5fd;
}

.loc-ic.on,
.loc-ic:hover {
  background: rgba(217, 119, 6, 0.94);
  border-color: #fef08a;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.6);
}

.loc-ic.on small,
.loc-ic:hover small {
  color: #fffbeb;
}

.loc-road {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(7, 14, 26, 0.76);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  white-space: nowrap;
}

.loc-bld-tag {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.35);
  font-size: 0.64rem;
}

.contact-route-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.contact-route-chip {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.48rem 0.65rem;
  background: #fdfaf3;
  border: 1.5px solid rgba(118, 78, 40, 0.38);
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-serif);
  transition: all 0.18s ease;
}

.contact-route-chip .chip-ic {
  font-family: var(--font-woodblock);
  font-size: 0.88rem;
  color: var(--ink-sumi);
}

.contact-route-chip small {
  font-size: 0.74rem;
  color: var(--ink-faded);
  font-weight: 600;
}

.contact-route-chip.is-active,
.contact-route-chip:hover {
  background: rgba(158, 33, 22, 0.09);
  border-color: var(--cinnabar-red);
  box-shadow: 0 3px 10px rgba(158, 33, 22, 0.12);
}

.contact-route-chip.is-active .chip-ic {
  color: var(--cinnabar-red);
}

.loc-steps-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
}

.loc-steps-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.58rem;
  background: rgba(244, 234, 212, 0.55);
  border: 1px solid rgba(118, 78, 40, 0.3);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--ink-body);
  cursor: pointer;
  transition: all 0.18s ease;
}

.loc-steps-list li i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(118, 78, 40, 0.22);
  color: var(--ink-sumi);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  flex-shrink: 0;
}

.loc-steps-list li.on {
  background: rgba(158, 33, 22, 0.12);
  border-color: var(--cinnabar-red);
  font-weight: 700;
  color: var(--ink-sumi);
}

.loc-steps-list li.on i {
  background: var(--cinnabar-red);
  color: #fff;
}

.map-3d-canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}

.map-3d-canvas:active {
  cursor: grabbing;
}

.map-3d-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.7rem;
  background: rgba(34, 22, 12, 0.92);
  border-bottom: 1.5px solid #8c5e32;
  color: #f8ebd4;
}

.map-3d-toolbar-title {
  font-family: var(--font-woodblock);
  font-size: 0.88rem;
  color: #fbf1de;
  letter-spacing: 0.04em;
}

.map-3d-cam-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.map-3d-cam-btn {
  appearance: none;
  font-family: var(--font-serif);
  font-size: 0.74rem;
  font-weight: 700;
  color: #f4e5ca;
  background: rgba(255, 246, 228, 0.12);
  border: 1px solid rgba(212, 178, 126, 0.36);
  border-radius: 4px;
  padding: 0.2rem 0.52rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.map-3d-cam-btn:hover,
.map-3d-cam-btn.active {
  background: var(--cinnabar-red);
  color: #fff;
  border-color: #f2aa9b;
}

.map-3d-legend-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.75rem;
  background: rgba(46, 30, 16, 0.92);
  border-top: 1px solid rgba(212, 178, 126, 0.35);
  font-size: 0.76rem;
  color: #fff8eb;
}

.map-3d-legend-bar strong,
.map-3d-legend-bar b {
  color: #ffd166 !important;
  font-weight: 800;
}

.contact-dept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.contact-dept-card {
  padding: 0.62rem 0.78rem;
  background: rgba(244, 234, 212, 0.58);
  border: 1px solid rgba(118, 78, 40, 0.34);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.32rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.contact-dept-card:hover {
  transform: translateY(-2px);
  border-color: var(--cinnabar-red);
  background: rgba(255, 248, 235, 0.95);
}

.yeojido-sub-ledger {
  padding: 0.95rem 1.1rem;
  background: #fdfaf3;
  border: 1px solid rgba(118, 78, 40, 0.35);
  border-left: 3.5px solid var(--cinnabar-red);
  border-radius: 5px;
}

.yeojido-three-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.yeojido-pillar-card {
  padding: 0.65rem 0.75rem;
  background: rgba(244, 233, 210, 0.65);
  border: 1px solid rgba(118, 78, 40, 0.3);
  border-radius: 4px;
}

.writer-photo-dropzone {
  border: 2px dashed rgba(158, 33, 22, 0.48);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  background: rgba(253, 250, 243, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
}

.writer-photo-dropzone:hover {
  background: rgba(158, 33, 22, 0.06);
  border-color: var(--cinnabar-red);
}

.writer-photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.writer-photo-chip {
  position: relative;
  border: 1px solid rgba(118, 78, 40, 0.4);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.writer-photo-chip img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  display: block;
}

.writer-photo-chip button {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(158, 33, 22, 0.92);
  color: #fff;
  border: 0;
  border-radius: 3px;
  font-size: 0.7rem;
  padding: 1px 5px;
  cursor: pointer;
}

/* 사무국 관리자 인증 전에는 글쓰기·수정·삭제 UI를 일반 방문자에게 완전히 숨김 */
.admin-only-ui {
  display: none !important;
}

body.is-wssc-admin .admin-only-ui {
  display: inline-flex !important;
}

body.is-wssc-admin div.admin-only-ui {
  display: flex !important;
}

.gyeonggi-svg-map {
  width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
  margin: 0 auto;
}

.map-city-path {
  stroke: #4a3319;
  stroke-width: 1.3;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.22s ease, opacity 0.22s ease;
}

.map-city-path:hover {
  opacity: 0.94;
  stroke: var(--cinnabar-red);
  stroke-width: 2.2;
}

.map-city-path.highlighted {
  fill: #b83224 !important;
  stroke: #4a0e08;
  stroke-width: 2.4;
}

.map-city-label {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 11.5px;
  fill: #181008;
  pointer-events: none;
}

.map-city-label.active-label {
  fill: #fff9f0;
  font-size: 13px;
}

.region-scroll-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.52rem;
}

.region-scroll-entry {
  padding: 0.68rem 0.92rem;
  background: #fdfaf3;
  border: 1px solid rgba(118, 78, 40, 0.34);
  border-left: 3.5px solid rgba(158, 33, 22, 0.55);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.region-scroll-entry:hover,
.region-scroll-entry.active-row {
  background: rgba(158, 33, 22, 0.08);
  border-left-color: var(--cinnabar-red);
  transform: translateX(3px);
}

.city-chip-btn {
  appearance: none;
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-sumi);
  background: #fdfaf3;
  border: 1px solid rgba(112, 80, 46, 0.45);
  border-radius: 4px;
  padding: 0.24rem 0.65rem;
  cursor: pointer;
}

.city-chip-btn.active,
.city-chip-btn:hover {
  color: #fff9f0;
  border-color: var(--cinnabar-red);
  background: var(--cinnabar-red);
}

/* ==========================================================================
   12. 제4권 · 규장 전각소 & 제5권 · 2열 대칭 연혁 그리드
   ========================================================================== */
.seal-studio-grid {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 1.15rem;
  align-items: center;
}

.hanji-form-input,
.hanji-form-select,
.hanji-form-textarea {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-sumi);
  background: #fdfaf3;
  border: 1.5px solid rgba(112, 76, 40, 0.48);
  border-radius: 4px;
  padding: 0.5rem 0.68rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hanji-form-input:focus,
.hanji-form-select:focus,
.hanji-form-textarea:focus {
  border-color: var(--cinnabar-red);
  box-shadow: 0 0 0 3px rgba(158, 33, 22, 0.14);
}

/* 제5권 4대 시대 편년 실록 — 좌우 2열 대칭 서첩 그리드 (한쪽 쏠림 0%) */
.history-eras-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  align-items: stretch;
}

/* ==========================================================================
   13. 제6권 · 조합 기별록 (화첩 그리드 & 목판 장부 목록)
   ========================================================================== */
.gibyeol-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

.gibyeol-folio-item {
  cursor: pointer;
  padding: 1rem;
  background: var(--hanji-paper-card);
  border: 1.5px solid rgba(118, 78, 40, 0.36);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(42, 26, 12, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gibyeol-folio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(42, 26, 12, 0.12);
  border-color: var(--cinnabar-red);
}

.gibyeol-thumb-mount {
  padding: 0.4rem;
  background: #efe2c6;
  border: 1px solid rgba(112, 76, 40, 0.32);
  border-radius: 4px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.gibyeol-thumb-mount img {
  width: 100%;
  height: 176px;
  object-fit: cover;
  border-radius: 2px;
  transition: transform 0.45s ease;
}

.gibyeol-folio-item:hover .gibyeol-thumb-mount img {
  transform: scale(1.03);
}

.gibyeol-meta-line {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cinnabar-red);
  margin-bottom: 0.25rem;
}

.gibyeol-item-title {
  font-family: var(--font-woodblock);
  font-size: 1.14rem;
  font-weight: 400;
  color: var(--ink-sumi);
  margin: 0.2rem 0 0.45rem;
  line-height: 1.42;
}

.gibyeol-item-excerpt {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-body);
  margin: 0;
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gibyeol-ledger-entry {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px dashed rgba(112, 76, 40, 0.35);
  cursor: pointer;
  transition: background 0.2s ease;
}

.gibyeol-ledger-entry:hover {
  background: rgba(158, 33, 22, 0.08);
}

/* ==========================================================================
   14. 판권기(Footer) · 모달 · 토스트
   ========================================================================== */
.codex-colophon-footer {
  margin-top: 3rem;
  padding-top: 1.8rem;
  text-align: center;
  border-top: 2px solid rgba(112, 76, 40, 0.38);
  color: var(--ink-faded);
  font-size: 0.92rem;
  font-weight: 600;
}

.coop-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(18, 12, 8, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.coop-modal-backdrop[hidden],
[hidden] {
  display: none !important;
}

.coop-modal-dialog {
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--hanji-light);
  padding: 2rem 2.2rem;
  border-radius: 6px;
  border: 2px solid #8c5e32;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  color: var(--ink-body);
}

.modal-thumbs-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.modal-thumbs-strip img {
  width: 68px;
  height: 50px;
  object-fit: cover;
  border-radius: 2px;
  cursor: pointer;
  opacity: 0.7;
  border: 2px solid transparent;
}

.modal-thumbs-strip img.active,
.modal-thumbs-strip img:hover {
  opacity: 1;
  border-color: var(--cinnabar-red);
}

.video-embed-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 4px;
}

.video-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.coop-toast {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: #1e140c;
  color: #fff8eb;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.68rem 1.4rem;
  border: 1.5px solid #d49b56;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   15. 반응형 (태블릿 & 모바일 320px~980px)
   ========================================================================== */
@media (max-width: 980px) {
  .codex-two-folio,
  .history-eras-grid,
  .partner-alliance-grid,
  .yeojido-three-pillars {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .chronicle-seal-scrolls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gibyeol-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding: 3.8rem 0.45rem 4.6rem;
  }

  .ancient-codex-folio {
    padding: 1.1rem 1.15rem 2.2rem 0.9rem;
  }

  .ancient-codex-folio::after {
    width: 10px;
  }

  .codex-inner-frame {
    padding: 0.95rem 0.8rem;
  }

  .codex-clauses-grid,
  .csr-album-pair,
  .gibyeol-archive-grid,
  .chronicle-seal-scrolls {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }

  .chronicle-brush-list li {
    grid-template-columns: 92px minmax(0, 1fr);
    font-size: 0.9rem;
  }

  .seal-studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 모바일에서는 우측 리모컨을 하단 고정 바로 전환하여 엄지손가락으로 편하게 조작 */
  .floating-codex-dock {
    right: 0.4rem;
    left: 0.4rem;
    bottom: 0.4rem;
    flex-direction: row;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.4rem 0.5rem;
  }
  .dock-divider {
    display: none;
  }
}

@media print {
  .sticky-codex-bar,
  .floating-codex-dock {
    display: none !important;
  }
  body {
    background: #fff !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   16. 모션 그래픽 시스템 (Emil Kowalski Philosophy · GPU Transform/Opacity 전용)
   ========================================================================== */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* 1) 권두 고화 화첩 — 금빛 송화가루 캔버스 & 다층 패럴랙스 */
.painting-scroll-frame {
  position: relative;
  overflow: hidden;
}

.painting-motion-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}

.painting-scroll-img,
.painting-vertical-colophon,
.painting-collector-seals {
  transition: transform 280ms var(--ease-out);
  will-change: transform;
}

/* 어보(직인) 낙관 날인 탄성 모션 */
@keyframes wsscSealStamp {
  0% {
    opacity: 0;
    transform: scale(1.28) translate3d(0, -10px, 0);
  }
  65% {
    opacity: 1;
    transform: scale(0.95) translate3d(0, 1px, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.is-stamping {
  animation: wsscSealStamp 280ms var(--ease-out) both;
}

/* 2) 실시간 경기 22읍 공공유통 키네틱 마키 리본 (GPU translate3d) */
.wssc-kinetic-ribbon {
  position: relative;
  overflow: hidden;
  margin: 1rem 0 1.4rem;
  padding: 0.52rem 0;
  background: linear-gradient(90deg, rgba(42, 26, 14, 0.94), rgba(74, 32, 22, 0.94), rgba(42, 26, 14, 0.94));
  border-top: 1.5px solid #c99752;
  border-bottom: 1.5px solid #c99752;
  border-radius: 4px;
  color: #f8ebd4;
  box-shadow: 0 6px 16px rgba(28, 16, 6, 0.16);
}

.wssc-kinetic-track {
  display: flex;
  width: max-content;
  gap: 2.2rem;
  animation: wsscMarqueeFlow 36s linear infinite;
  will-change: transform;
}

.wssc-kinetic-ribbon:hover .wssc-kinetic-track {
  animation-play-state: paused;
}

.wssc-kinetic-item {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  color: #f7e9cf;
}

.wssc-kinetic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
  animation: wsscPulseDot 1.8s var(--ease-in-out) infinite;
}

@keyframes wsscMarqueeFlow {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes wsscPulseDot {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.22);
  }
}

/* 3) 스크롤 진입 스태거 리빌 (scale(0) 금지 -> scale(0.96) + translateY(18px)) */
.wssc-motion-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.97);
  transition:
    opacity 420ms var(--ease-out) var(--wssc-stagger, 0ms),
    transform 420ms var(--ease-out) var(--wssc-stagger, 0ms);
  will-change: opacity, transform;
}

.wssc-motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* 4) 마우스 3D 틸트 & 금빛 스포트라이트 (포인터 장비 전용) */
.wssc-tilt-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .wssc-tilt-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
      340px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(255, 214, 130, 0.22),
      transparent 70%
    );
    opacity: 0;
    transition: opacity 220ms var(--ease-out);
  }

  .wssc-tilt-card:hover::before {
    opacity: 1;
  }

  .woodblock-slip-btn:hover,
  .silk-bookmark-link:hover,
  .dock-slip-btn:hover {
    transform: translate3d(0, -2px, 0);
  }
}

/* 버튼 즉각 눌림 피드백 (120ms --ease-out, scale(0.97)) */
.woodblock-slip-btn:active,
.dock-slip-btn:active,
.contact-route-chip:active {
  transform: scale(0.97) !important;
  transition-duration: 110ms !important;
}

/* 어람 실록 총기 어보 인장 은은한 숨결 모션 */
.scroll-cinnabar-stamp {
  animation: wsscSealFloat 4.2s var(--ease-in-out) infinite;
}

@keyframes wsscSealFloat {
  0%,
  100% {
    transform: rotate(-7deg) scale(1);
  }
  50% {
    transform: rotate(-4deg) scale(1.05);
  }
}

/* 서신 문초 발송 버튼 비행 피드백 */
.is-dispatching {
  transform: translate3d(8px, -4px, 0) scale(1.03);
  transition: transform 240ms var(--ease-out);
}

/* 5) 접근성: 움직임 줄이기(prefers-reduced-motion) 완벽 대응 */
@media (prefers-reduced-motion: reduce) {
  .wssc-kinetic-track,
  .wssc-kinetic-dot,
  .scroll-cinnabar-stamp,
  .is-stamping {
    animation: none !important;
  }

  .wssc-motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 180ms ease !important;
  }

  .wssc-tilt-card,
  .painting-scroll-img,
  .painting-vertical-colophon,
  .painting-collector-seals {
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   16. 일반 공식 홈페이지(모던 뷰) 전환 하이라이트 버튼 — 눈에 확 띄고 눌러보고 싶은 로고 CI 그라디언트 버튼
   ========================================================================== */
@keyframes wsscModernSwitchPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(216, 48, 123, 0.55), 0 4px 16px rgba(140, 40, 140, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(216, 48, 123, 0), 0 6px 22px rgba(24, 168, 216, 0.58);
  }
}

.cta-switch-modern-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  background: linear-gradient(135deg, #d8307b 0%, #8c288c 52%, #18a8d8 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #fde68a !important;
  border-radius: 999px !important;
  padding: 0.34rem 0.92rem !important;
  font-family: var(--font-serif);
  font-size: 0.84rem !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  letter-spacing: -0.01em;
  cursor: pointer;
  animation: wsscModernSwitchPulse 2.4s infinite;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.cta-switch-modern-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.1);
}

.cta-switch-modern-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  max-width: 780px;
  margin: 0.85rem auto 1.05rem;
  padding: 0.72rem 1.25rem;
  background: linear-gradient(95deg, #1e1b2e 0%, #4a154b 48%, #831843 100%);
  border: 2px solid #f9a8d4;
  border-radius: 999px;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(131, 24, 67, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.cta-switch-modern-banner:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 34px rgba(216, 48, 123, 0.42);
}

.cta-switch-modern-banner .switch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #d8307b, #18a8d8);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.cta-switch-modern-banner .switch-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fdf2f8;
}

.cta-switch-modern-banner .switch-go {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fde047;
  color: #1e1b24;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}
