
:root {
  --navy-deep: #0a1420;
  --navy-mid: #10233b;
  --gold: #c9a15a;
  --gold-bright: #e7c789;
  --paper: #faf6ee;
  --ink: #2a2621;
  --ink-soft: #55503f;
  --rule: #ddd2b8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Serif KR', 'Batang', serif;
  line-height: 1.9;
  font-size: 18px;
}
.hero {
  background: radial-gradient(ellipse at 30% 20%, #16283f 0%, var(--navy-deep) 65%);
  color: var(--gold-bright);
  padding: 64px 24px 40px;
  text-align: center;
}
.hero .kicker {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13px;
  letter-spacing: 0.35em;
  color: #8fa3bd;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(231,199,137,0.25);
}
.hero .subtitle {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  color: #cdd8e6;
  margin: 0 0 10px;
}
.hero .volume-badge {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 22px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
main > p { margin: 0 0 22px; }
h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  margin: 56px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
  color: var(--navy-mid);
}
main > h2:first-of-type { margin-top: 0; }
h3 {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  margin: 44px 0 4px;
}
h4 { font-size: 20px; margin: 30px 0 12px; }
a { color: #8a6420; }
a:hover { color: #c9a15a; }
blockquote {
  margin: 18px 0 28px;
  padding: 18px 22px;
  background: #f2ead8;
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 15.5px;
  color: var(--ink-soft);
}
blockquote p { margin: 0; }
figure.illustration {
  margin: 28px 0 34px;
  text-align: center;
}
figure.illustration img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20,20,10,0.18);
}
figure.illustration figcaption {
  margin-top: 10px;
  color: #8a8471;
  padding: 0 12px;
}
hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}
.book-author-signature, .book-production-credit {
  margin: 36px 0;
  padding: 18px 20px;
  background: #f2ead8;
  border-radius: 8px;
  text-align: center;
  color: var(--navy-mid);
}
main ul { padding-left: 22px; }
main li { margin: 6px 0; }
main > ul > li > strong {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--navy-mid);
}
.cover-page main > p:first-of-type img {
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(20,20,10,0.25);
  display: block;
  margin: 0 auto 8px;
}
.nav-footer {
  max-width: 720px;
  margin: 40px auto 80px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
.nav-footer a {
  flex: 1;
  text-decoration: none;
  padding: 18px 22px;
  border-radius: 10px;
  background: var(--navy-deep);
  color: var(--gold-bright) !important;
  text-align: center;
  font-size: 15px;
}
.nav-footer a.disabled {
  background: #e5ded0;
  color: #b3ab95 !important;
  pointer-events: none;
}
.nav-footer a small {
  display: block;
  font-size: 12px;
  color: #8fa3bd;
  margin-bottom: 4px;
  font-weight: 400;
}
.nav-footer a.disabled small { color: #c2bba9; }
.top-toc-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13px;
  color: #cdd8e6 !important;
  text-decoration: none;
  background: rgba(10,20,32,0.55);
  padding: 8px 14px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.search-widget { position: fixed; top: 18px; right: 18px; z-index: 30; font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif; }
.search-toggle {
  width: 40px; height: 40px; border-radius: 999px;
  background: rgba(10,20,32,0.55); color: #cdd8e6; border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.search-toggle:hover { background: rgba(10,20,32,0.75); }
.search-box {
  position: absolute; top: 48px; right: 0; display: none; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--gold); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22); width: 260px;
}
.search-box.open { display: flex; }
.search-box input {
  flex: 1; border: none; outline: none; font-size: 14px; font-family: inherit; min-width: 0;
}
.search-box .count { font-size: 12px; color: #8a8471; white-space: nowrap; }
.search-box button.nav {
  border: none; background: none; cursor: pointer; color: #8a6420; font-size: 15px; padding: 2px 5px;
}
.search-box button.nav:hover { color: #c9a15a; }
mark.search-hit { background: #f2e6c8; color: inherit; border-radius: 2px; }
mark.search-hit.active { background: #e7c789; }
.to-top {
  position: fixed; bottom: 26px; right: 26px; width: 48px; height: 48px; border-radius: 999px;
  background: var(--navy-deep); color: var(--gold-bright); border: none; cursor: pointer;
  font-size: 20px; box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: #16283f; }


/* ==== shared floating toolbar: search / toc / back-to-top ==== */
.yt-toolbar{
  position:fixed;right:20px;bottom:20px;z-index:40;
  display:flex;flex-direction:column;gap:8px;
  background:rgba(10,20,32,0.72);backdrop-filter:blur(6px);
  border:1px solid rgba(201,161,90,0.35);border-radius:14px;padding:6px;
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
}
.yt-tbtn{
  width:42px;height:42px;border-radius:10px;background:transparent;border:none;
  color:#cdd8e6;cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .15s ease,color .15s ease;padding:0;
}
.yt-tbtn:hover{background:rgba(201,161,90,0.22);color:var(--gold-bright);}
.yt-tbtn svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;}
#ytBtnTop{opacity:0;pointer-events:none;transform:translateY(6px);}
#ytBtnTop.show{opacity:1;pointer-events:auto;transform:translateY(0);}

.yt-drawer-backdrop{position:fixed;inset:0;background:rgba(10,14,20,0.5);z-index:50;opacity:0;pointer-events:none;transition:opacity .18s ease;}
.yt-drawer-backdrop.open{opacity:1;pointer-events:auto;}
.yt-drawer{
  position:fixed;top:0;right:0;height:100%;width:min(360px,88vw);
  background:var(--paper);border-left:1px solid var(--rule);
  z-index:51;transform:translateX(100%);transition:transform .22s ease;
  display:flex;flex-direction:column;
}
.yt-drawer.open{transform:translateX(0);}
.yt-drawer-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid var(--rule);font-family:'Noto Sans KR','Malgun Gothic',sans-serif;}
.yt-drawer-head h4{margin:0;font-size:14px;letter-spacing:.04em;color:var(--ink-soft);text-transform:uppercase;}
.yt-drawer-head button{background:none;border:none;cursor:pointer;color:var(--ink-soft);font-size:20px;line-height:1;padding:4px;}
.yt-drawer-list{overflow-y:auto;padding:10px 0;font-family:'Noto Sans KR','Malgun Gothic',sans-serif;}
.yt-drawer-list .yt-group{padding:12px 20px 4px;font-size:12.5px;font-weight:700;color:var(--gold);letter-spacing:.03em;}
.yt-drawer-list a{display:block;padding:8px 20px 8px 28px;font-size:14px;color:var(--ink);text-decoration:none;border-bottom:1px solid #f2ead8;}
.yt-drawer-list a:hover{background:#f2ead8;text-decoration:none;}
.yt-drawer-list .yt-empty{padding:20px;color:var(--ink-soft);font-size:13.5px;}

.yt-search-modal{position:fixed;inset:0;background:rgba(10,14,20,0.55);z-index:60;display:flex;align-items:flex-start;justify-content:center;padding:9vh 20px;opacity:0;pointer-events:none;transition:opacity .15s ease;}
.yt-search-modal.open{opacity:1;pointer-events:auto;}
.yt-search-box{width:100%;max-width:560px;background:#fff;border:1px solid var(--gold);border-radius:10px;box-shadow:0 16px 44px rgba(0,0,0,0.3);overflow:hidden;max-height:74vh;display:flex;flex-direction:column;}
.yt-search-box input{width:100%;border:none;padding:18px 20px;font-size:16px;font-family:'Noto Serif KR',serif;outline:none;border-bottom:1px solid var(--rule);box-sizing:border-box;}
.yt-search-results{overflow-y:auto;}
.yt-search-results a{display:block;text-decoration:none;padding:12px 20px;border-bottom:1px solid #f2ead8;color:var(--ink);}
.yt-search-results a:hover{background:#f8f3e5;}
.yt-search-results .r-title{font-family:'Noto Serif KR',serif;font-weight:700;font-size:14.5px;margin-bottom:3px;}
.yt-search-results .r-title mark, .yt-search-results .r-message mark{background:#f2e6c8;color:inherit;border-radius:2px;}
.yt-search-results .r-book{font-size:11.5px;color:var(--gold);margin-bottom:3px;}
.yt-search-results .r-message{font-size:13px;color:var(--ink-soft);line-height:1.55;}
.yt-search-empty,.yt-hint{padding:16px 20px;color:var(--ink-soft);font-size:13px;}
.yt-hint{border-top:1px solid var(--rule);padding:10px 20px;font-size:12.5px;}
kbd{border:1px solid var(--rule);border-radius:4px;padding:1px 6px;font-size:12px;font-family:inherit;color:var(--ink-soft);}

.nav-top {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13.5px;
}
.nav-top a {
  text-decoration: none;
  color: var(--navy-mid);
  background: rgba(201,161,90,0.16);
  border: 1px solid var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-top a:hover { background: rgba(201,161,90,0.32); }
.nav-top .nav-top-side { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 480px) {
  .nav-top { justify-content: flex-start; }
  .nav-top .nav-top-side { justify-content: flex-start; }
}

details.original-toggle {
  margin: 22px 0 4px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
details.original-toggle > summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  font-size: 14.5px;
  color: #4f7a92;
  text-decoration: underline;
  text-underline-offset: 3px;
}
details.original-toggle > summary::-webkit-details-marker { display: none; }
details.original-toggle > summary:hover { color: var(--navy-mid); }
.original-box {
  margin-top: 10px;
  padding: 18px 22px;
  border: 1.5px solid #b7d8b0;
  border-radius: 10px;
  background: #f5faf3;
  font-size: 15.5px;
  line-height: 1.85;
}
.original-box .original-num {
  font-size: 13px; font-weight: 700; color: #6fa86a; margin-bottom: 4px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
.original-box .original-title {
  font-size: 17px; font-weight: 700; color: var(--navy-mid); margin-bottom: 10px;
  font-family: 'Noto Serif KR', 'Batang', serif;
}
.original-box .original-body p { margin: 0 0 12px; }
.original-box .original-body p:last-child { margin-bottom: 0; }
.original-box .original-source {
  margin-top: 12px; font-size: 12.5px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
.original-box .original-source a { color: #6fa86a; text-decoration: none; }
.original-box .original-source a:hover { text-decoration: underline; }
