/* ==================================================================
   オンライン図書館 3B版 — 見た目
   「朝の光が入る子ども図書室」。
   Beauty＝クリームの紙・薔薇と若葉の配色・明朝の見出し
   Beast ＝ふくろうの司書・棚で眠る猫
   Baby  ＝母と子・眠る赤ちゃん・覗く子ども
   ================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Shippori+Mincho+B1:wght@500;700;800&family=Zen+Maru+Gothic:wght@400;500;700&family=Cormorant+Garamond:ital,wght@0,500;0,600;1,400;1,500&display=swap");

:root {
  --cream: #FBF6EE;
  --cream-2: #F5ECDF;
  --cream-3: #EEE1CF;
  --paper: #FFFDF9;
  --ink: #2E2622;
  --ink-2: #5C4F47;
  --ink-3: #9A8B80;
  --rose: #D98A7A;
  --rose-2: #C96A5B;
  --rose-3: #F3D6CE;
  --sage: #9DB79A;
  --sage-2: #6F8F6C;
  --sage-3: #E1EBDD;
  --gold: #D9A441;
  --gold-2: #F0CF7E;
  --gold-3: #FBEFD2;
  --honey: #B87E2A;
  --wood: #C9A98A;
  --wood-2: #B08E6E;
  --sky: #DCE9F2;
  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --latin: "Cormorant Garamond", "Shippori Mincho B1", serif;
  --shadow: 0 24px 50px -24px rgba(92, 60, 40, .35), 0 8px 18px -10px rgba(92, 60, 40, .18);
  --shadow-soft: 0 10px 30px -14px rgba(92, 60, 40, .25);
  --radius: 18px;
  --radius-s: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: clip; min-height: 100vh;
  font-family: var(--body); color: var(--ink); background: var(--cream);
  line-height: 1.9; letter-spacing: .02em; -webkit-font-smoothing: antialiased;
}
body::before { /* 朝の光と紙の粒 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 12% 0%, rgba(240, 207, 126, .28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 95% 10%, rgba(243, 214, 206, .45), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(157, 183, 154, .22), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }
.hidden, [hidden] { display: none !important; }
.latin { font-family: var(--latin); letter-spacing: .14em; text-transform: uppercase; }
.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--display); }

/* ---------- 挿絵の動き ---------- */
.art { display: inline-block; vertical-align: middle; }
.owl-blink { transform-origin: 60px 58px; animation: blink 5.2s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.sway { transform-origin: 50% 50%; animation: sway 9s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(6px); opacity: .7; } }
.zzz text { animation: zz 2.6s ease-in-out infinite; }
.zzz text:nth-child(2) { animation-delay: .5s; } .zzz text:nth-child(3) { animation-delay: 1s; }
@keyframes zz { 0%, 100% { opacity: .2; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }
.float { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .owl-blink, .sway, .zzz text, .float, .card, .rise { animation: none !important; } }

/* ---------- ヘッダー ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 22px;
  background: rgba(251, 246, 238, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(92, 60, 40, .10);
}
.hdr .brand { display: flex; align-items: center; gap: 10px; }
.hdr .brand .mark { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-3); display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px rgba(217,164,65,.5); }
.hdr .brand .mark svg { width: 34px; height: 34px; }
.hdr .brand .jp { font-family: var(--display); font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: .22em; }
.hdr .brand .en { font-family: var(--latin); font-style: italic; font-size: 13px; letter-spacing: .1em; color: var(--ink-3); }
.hdr nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.hdr nav a, .hdr nav button {
  font-size: 13.5px; font-weight: 500; letter-spacing: .1em; color: var(--ink-2); padding: 7px 12px;
  border: 0; border-radius: 999px; background: none; transition: background .2s, color .2s;
}
.hdr nav a:hover, .hdr nav button:hover { background: rgba(217, 138, 122, .14); color: var(--rose-2); }
.hdr nav a.on { background: var(--ink); color: var(--cream); }
.hdr nav a.my { color: var(--rose-2); }
.hdr nav a.my.on { background: var(--rose-2); color: #fff; }
@media (max-width: 640px) {
  .hdr { padding: 8px 14px; flex-wrap: wrap; }
  .hdr nav { flex: 1 1 100%; justify-content: flex-start; margin-top: 2px; }
  .hdr .brand .en { display: none; }
  .hdr .brand .jp { font-size: 18px; letter-spacing: .16em; }
  .hdr nav a, .hdr nav button { padding: 6px 9px; font-size: 12.5px; }
}

/* ---------- 共通の小物 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
  border: 1.5px solid rgba(92, 60, 40, .22); color: var(--ink-2); background: rgba(255,255,255,.6);
  font-size: 14px; font-weight: 500; letter-spacing: .08em; transition: background .2s, transform .15s, border-color .2s, box-shadow .2s;
}
.btn:hover { background: #fff; border-color: var(--rose); color: var(--rose-2); }
.btn:active { transform: translateY(1px); }
.btn.brass, .btn.primary {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-2) 100%); color: #fff; border-color: transparent; font-weight: 700;
  box-shadow: 0 10px 22px -10px rgba(201, 106, 91, .7);
}
.btn.brass:hover, .btn.primary:hover { filter: brightness(1.05); color: #fff; transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(201, 106, 91, .8); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }
.muted { color: var(--ink-3); }
.err { color: var(--rose-2); font-size: 14px; }
.ok { color: var(--sage-2); font-size: 14px; }
.loading { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); font-family: var(--latin); font-style: italic; letter-spacing: .12em; font-size: 15px; padding: 36px 0; text-align: center; }
.loading .art { animation: floaty 2.4s ease-in-out infinite; }
.page-title { margin: 30px 0 4px; font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: .1em; color: var(--ink); line-height: 1.4; }
.page-sub { margin: 0 0 20px; color: var(--ink-2); font-size: 14.5px; }
.eyebrow { font-family: var(--latin); font-style: italic; color: var(--rose-2); font-size: 15px; letter-spacing: .08em; }
.rise { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.rise:nth-child(2) { animation-delay: .08s; } .rise:nth-child(3) { animation-delay: .16s; } .rise:nth-child(4) { animation-delay: .24s; } .rise:nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.bubble { /* ふくろうの吹き出し */
  position: relative; display: inline-block; padding: 10px 16px; border-radius: 16px; background: #fff;
  border: 1.5px solid rgba(217,164,65,.45); font-size: 14px; color: var(--ink-2); box-shadow: var(--shadow-soft);
}
.bubble::before { content: ""; position: absolute; left: -9px; top: 18px; width: 14px; height: 14px; background: #fff; border-left: 1.5px solid rgba(217,164,65,.45); border-bottom: 1.5px solid rgba(217,164,65,.45); transform: rotate(45deg); }
.guide { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0 10px; }
.guide .art { flex: 0 0 auto; }

/* ---------- ログイン（閲覧証） ---------- */
.login-stage { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 70px 16px 30px; }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; width: min(960px, 100%); }
.login-hero { text-align: center; position: relative; }
.login-hero .art-mother { width: min(360px, 90%); height: auto; }
.login-hero .welcome { margin: 10px auto 0; max-width: 360px; }
.login-hero .welcome .eyebrow { display: block; margin-bottom: 4px; }
.login-hero .welcome h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: .08em; line-height: 1.5; }
.login-hero .welcome p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.card {
  width: min(440px, 100%); margin: 0 auto; padding: 36px 36px 28px; position: relative;
  background: var(--paper); color: var(--ink); border-radius: 26px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(92, 60, 40, .06);
  animation: card-in .8s cubic-bezier(.2,.8,.2,1) both;
}
.card::before { /* 閲覧証のミシン目 */
  content: ""; position: absolute; left: 14px; right: 14px; top: 14px; bottom: 14px; pointer-events: none;
  border: 1.5px dashed rgba(217, 138, 122, .45); border-radius: 16px;
}
.card .owl-seat { display: flex; justify-content: center; margin: -70px 0 -6px; }
.card .owl-seat .art { }
.card .stamp { font-family: var(--latin); font-style: italic; text-align: center; letter-spacing: .12em; font-size: 15px; color: var(--rose-2); margin-bottom: 2px; }
.card h1 { margin: 0 0 2px; text-align: center; font-size: 28px; letter-spacing: .28em; font-weight: 800; color: var(--ink); }
.card .sub { text-align: center; font-size: 13px; color: var(--ink-3); letter-spacing: .12em; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid rgba(92, 60, 40, .18);
  background: #fff; color: var(--ink); border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(217,138,122,.18); }
.card .btn.brass { width: 100%; margin-top: 6px; padding: 13px; font-size: 15px; letter-spacing: .24em; }
.card .foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--ink-3); letter-spacing: .08em; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) rotate(-1deg); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .login-grid { grid-template-columns: 1fr; gap: 8px; }
  .login-hero .art-mother { width: min(260px, 70%); }
  .login-hero .welcome h2 { font-size: 20px; }
  .card { padding: 30px 24px 24px; }
}

/* ---------- 本棚 ---------- */
.shelf-unit { position: relative; margin: 26px 0 44px; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.shelf-head .plaque {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; border-radius: 999px;
  background: #fff; border: 1.5px solid rgba(92,60,40,.12); box-shadow: var(--shadow-soft);
  font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .12em; color: var(--ink);
}
.shelf-head .plaque .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--leather, var(--rose)); display: grid; place-items: center; color: #fff; font-family: var(--latin); font-size: 12px; }
.shelf-head .plaque small { font-family: var(--latin); font-style: italic; font-size: 13px; letter-spacing: .06em; font-weight: 500; color: var(--ink-3); text-transform: none; }
.shelf-head .note { font-size: 13.5px; color: var(--ink-2); }
.shelf-head .count { font-family: var(--latin); font-style: italic; color: var(--ink-3); letter-spacing: .06em; font-size: 15px; }
.shelf-cat { position: absolute; right: 30px; bottom: 4px; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(92,60,40,.25)); }
.shelf {
  position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 30px 22px 0; min-height: 236px;
  overflow-x: auto; overflow-y: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 40%), var(--cream-2);
  border-radius: 22px 22px 0 0; border: 1.5px solid rgba(92,60,40,.10); border-bottom: 0;
  scrollbar-width: thin; scrollbar-color: var(--wood) transparent;
}
.shelf-board {
  height: 16px; border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, var(--wood), var(--wood-2));
  box-shadow: 0 14px 24px -12px rgba(92,60,40,.45), inset 0 1px 0 rgba(255,255,255,.35);
}
.shelf.empty { align-items: center; justify-content: center; color: var(--ink-2); font-size: 14px; flex-direction: column; gap: 6px; padding-bottom: 20px; text-align: center; }
.shelf-peek { flex: 0 0 auto; align-self: flex-end; margin-left: 4px; margin-bottom: -6px; }

/* 背表紙 */
.spine {
  --leather: var(--rose); --leather2: var(--rose-2);
  flex: 0 0 auto; width: 58px; height: 196px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(90deg, rgba(0,0,0,.10), rgba(255,255,255,.28) 14%, rgba(255,255,255,0) 32%, rgba(0,0,0,.06) 85%, rgba(0,0,0,.14)), linear-gradient(180deg, var(--leather), var(--leather2));
  box-shadow: 0 10px 14px -8px rgba(92,60,40,.5), inset 0 0 0 1px rgba(0,0,0,.06);
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.18);
  transform-origin: bottom center; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; cursor: pointer;
}
.spine::before, .spine::after { content: ""; position: absolute; left: 8px; right: 8px; height: 2px; background: rgba(255,255,255,.55); }
.spine::before { top: 10px; } .spine::after { bottom: 9px; }
.spine .t { writing-mode: vertical-rl; text-orientation: mixed; font-family: var(--display); font-size: 13px; font-weight: 700; letter-spacing: .1em; max-height: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
.spine .n { font-family: var(--latin); font-size: 11px; letter-spacing: .08em; opacity: .9; }
.spine:hover { transform: translateY(-14px) rotate(-2deg); box-shadow: 0 26px 24px -14px rgba(92,60,40,.55); }
.spine.tall { height: 214px; } .spine.short { height: 180px; } .spine.wide { width: 68px; }
.spine.oxblood, .spine.rose { --leather: var(--rose); --leather2: var(--rose-2); }
.spine.navy, .spine.sky { --leather: #8FB3CC; --leather2: #5F8FAF; }
.spine.forest, .spine.sage { --leather: var(--sage); --leather2: var(--sage-2); }
.spine.umber, .spine.honey { --leather: var(--gold-2); --leather2: var(--gold); color: #5a4212; text-shadow: none; }
.spine.umber::before, .spine.umber::after, .spine.honey::before, .spine.honey::after { background: rgba(90,66,18,.35); }
.spine.black, .spine.cocoa { --leather: #A78B77; --leather2: #7D6552; }
.spine.plum, .spine.lilac { --leather: #C3A6CB; --leather2: #9B7AA6; }
.spine.ghost { opacity: .3; pointer-events: none; }
.shelf-more { flex: 0 0 auto; align-self: center; margin-left: 10px; color: var(--ink-3); font-family: var(--latin); font-style: italic; letter-spacing: .08em; font-size: 15px; }
.shelf-link { display: block; }
.shelf-link:hover .spine { transform: translateY(-6px); }

/* 棚ページ：本を1冊ずつカードで並べる */
.book-list { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .book-list { grid-template-columns: 1fr 1fr; } }
.book-row {
  display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: stretch;
  background: var(--paper); border: 1.5px solid rgba(92,60,40,.08);
  padding: 16px; border-radius: var(--radius); transition: border-color .2s, transform .2s, box-shadow .2s; box-shadow: var(--shadow-soft);
}
.book-row:hover { border-color: var(--rose); transform: translateY(-3px); box-shadow: var(--shadow); }
.book-row .mini {
  --leather: var(--rose); --leather2: var(--rose-2);
  border-radius: 8px 8px 4px 4px; min-height: 96px; display: grid; place-items: center;
  background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(255,255,255,.3) 18%, rgba(0,0,0,.06)), linear-gradient(180deg, var(--leather), var(--leather2));
  color: #fff; font-family: var(--latin); font-size: 12px; letter-spacing: .08em; box-shadow: 0 8px 12px -8px rgba(92,60,40,.5); position: relative;
}
.book-row .mini::before, .book-row .mini::after { content: ""; position: absolute; left: 6px; right: 6px; height: 1.5px; background: rgba(255,255,255,.55); }
.book-row .mini::before { top: 8px; } .book-row .mini::after { bottom: 8px; }
.book-row h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; letter-spacing: .04em; color: var(--ink); line-height: 1.5; }
.book-row p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); }
.book-row .kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .08em; padding: 2px 10px; border-radius: 999px; background: var(--sage-3); color: var(--sage-2); font-weight: 700; }
.tag.deep { background: var(--rose-3); color: var(--rose-2); }
.tag.dim { opacity: .45; background: var(--cream-3); color: var(--ink-3); }

/* ---------- 開いた本（資料ページ） ---------- */
.desk { position: relative; z-index: 1; padding: 22px 0 80px; }
.book-open { position: relative; max-width: 860px; margin: 0 auto; perspective: 1600px; }
.cover {
  position: absolute; inset: 0; z-index: 3; border-radius: 12px 22px 22px 12px; transform-origin: left center;
  --leather: var(--rose); --leather2: var(--rose-2);
  background: linear-gradient(90deg, rgba(0,0,0,.12), rgba(255,255,255,.25) 6%, rgba(0,0,0,0) 30%, rgba(0,0,0,.08)), linear-gradient(180deg, var(--leather), var(--leather2));
  box-shadow: var(--shadow); display: grid; place-items: center; color: #fff; text-align: center; padding: 40px;
  animation: cover-open 1.3s cubic-bezier(.6,.05,.3,1) .3s forwards; pointer-events: none;
}
.cover::before { content: ""; position: absolute; inset: 18px; border: 2px solid rgba(255,255,255,.55); border-radius: 10px; }
.cover .ct { font-family: var(--display); font-size: clamp(20px, 3.5vw, 30px); font-weight: 800; letter-spacing: .12em; line-height: 1.5; }
.cover .cs { font-family: var(--latin); font-style: italic; letter-spacing: .2em; font-size: 15px; margin-top: 14px; opacity: .9; }
@keyframes cover-open { to { transform: rotateY(-180deg); opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .cover { animation-duration: .01s; animation-delay: 0s; } }

.paper {
  position: relative; z-index: 2; color: var(--ink); background: var(--paper);
  border-radius: 12px 22px 22px 12px; padding: clamp(26px, 5vw, 56px) clamp(20px, 6vw, 64px) 40px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(92,60,40,.06);
}
.paper::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px; border-radius: 12px 0 0 12px; background: linear-gradient(90deg, rgba(92,60,40,.10), transparent); pointer-events: none; }
.ribbon { position: absolute; top: -8px; right: 44px; width: 18px; height: 110px; z-index: 4; background: linear-gradient(180deg, var(--rose), var(--rose-2)); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); box-shadow: 0 4px 6px rgba(0,0,0,.15); }
.paper .crumbs { font-size: 12.5px; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.paper .crumbs a:hover { color: var(--rose-2); }
.paper .kind-tabs { display: inline-flex; gap: 4px; margin: 0 0 22px; padding: 4px; border-radius: 999px; background: var(--cream-2); }
.paper .kind-tabs a { padding: 6px 16px; font-size: 13px; letter-spacing: .1em; color: var(--ink-3); border-radius: 999px; font-weight: 700; }
.paper .kind-tabs a.on { color: #fff; background: var(--rose-2); }
.paper .kind-tabs a.off { opacity: .4; cursor: default; }
.paper h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.45; margin: 0 0 10px; letter-spacing: .04em; font-weight: 800; color: var(--ink); }
.paper .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); letter-spacing: .06em; margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1.5px dashed rgba(92,60,40,.18); }
.paper .meta .tags span { margin-right: 6px; color: var(--sage-2); }
.paper .read-guide { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 12px 16px; border-radius: 14px; background: var(--gold-3); font-size: 13.5px; color: var(--ink-2); }
.prose { font-size: 16.5px; line-height: 2.05; }
.prose > :first-child { margin-top: 0; }
.prose .lead { font-size: 18px; color: var(--ink-2); font-family: var(--display); }
.prose .lead::first-letter { font-size: 2.6em; float: left; line-height: 1; padding: 6px 8px 0 0; color: var(--rose-2); font-weight: 800; }
.prose p { margin: 0 0 1.2em; }
.prose p.blank { margin: 0; height: .6em; }
.prose h2 { font-size: 21px; margin: 2em 0 .8em; letter-spacing: .06em; font-weight: 800; color: var(--ink); padding-left: 14px; border-left: 4px solid var(--rose); border-radius: 2px; }
.prose h3 { font-size: 18px; margin: 1.8em 0 .6em; font-weight: 700; color: var(--ink); }
.prose h4 { font-size: 16px; margin: 1.5em 0 .5em; font-weight: 700; color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.6em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose ul { list-style: none; }
.prose ul > li::before { content: "●"; color: var(--sage); font-size: .6em; margin-left: -1.6em; margin-right: .9em; vertical-align: .25em; }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--sage); background: var(--sage-3); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose .callout { display: flex; gap: 12px; margin: 1.4em 0; padding: 14px 18px; background: var(--gold-3); border: 1.5px solid rgba(217,164,65,.4); border-radius: 14px; }
.prose .callout-icon { color: var(--honey); }
.prose .callout p:last-child { margin-bottom: 0; }
.prose details { margin: 1em 0; padding: 8px 14px; border: 1.5px solid rgba(92,60,40,.16); border-radius: 12px; }
.prose summary { cursor: pointer; font-weight: 700; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--cream-2); padding: 1px 6px; border-radius: 6px; }
.prose pre { overflow-x: auto; padding: 14px; background: var(--cream-2); border-radius: 12px; }
.prose pre code { background: none; padding: 0; }
.prose figure { margin: 1.6em 0; text-align: center; }
.prose figure img { max-width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow-soft); }
.prose figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.prose .table-wrap { overflow-x: auto; margin: 1.4em 0; border-radius: 12px; border: 1.5px solid rgba(92,60,40,.12); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-bottom: 1px solid rgba(92,60,40,.12); padding: 10px 14px; vertical-align: top; text-align: left; }
.prose th { background: var(--rose-3); font-weight: 700; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }
.prose a { color: var(--rose-2); text-decoration: underline; text-underline-offset: 3px; }
.prose .columns { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.prose .c-red { color: #a33; } .prose .c-blue { color: #35a; } .prose .c-green { color: #385; } .prose .c-gray { color: #777; } .prose .c-orange { color: #c60; } .prose .c-purple { color: #74a; } .prose .c-brown { color: #853; } .prose .c-pink { color: #b47; } .prose .c-yellow { background: rgba(255,230,120,.5); }
.prose .c-red_background { background: rgba(200,60,60,.12); } .prose .c-blue_background { background: rgba(60,90,200,.12); } .prose .c-yellow_background { background: rgba(255,230,120,.4); } .prose .c-green_background { background: rgba(60,160,90,.12); } .prose .c-gray_background { background: rgba(0,0,0,.06); }

.next-card { /* ライト版末尾の誘導 */
  margin: 40px 0 10px; padding: 24px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(135deg, var(--rose-3), var(--gold-3)); display: grid; gap: 10px; justify-items: center;
}
.next-card .q { font-family: var(--display); font-size: 16px; color: var(--ink); margin: 0; letter-spacing: .04em; font-weight: 700; }
.next-card .btn { background: #fff; border-color: transparent; color: var(--rose-2); box-shadow: var(--shadow-soft); }
.paper .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1.5px dashed rgba(92,60,40,.18); }
.paper .turn { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; font-size: 13px; color: var(--ink-3); }
.paper .turn a:hover { color: var(--rose-2); }
.paper .turn span { max-width: 45%; }

/* ---------- 目録（検索） ---------- */
.catalog { max-width: 720px; margin: 22px auto 0; padding: 8px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); border: 1.5px solid rgba(92,60,40,.08); }
.catalog form { display: flex; gap: 8px; align-items: center; }
.catalog input { flex: 1; min-width: 0; padding: 12px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: 16px; outline: none; }
.catalog .btn { flex: 0 0 auto; }
.hits { max-width: 720px; margin: 24px auto; display: grid; gap: 10px; }
.hit { display: block; padding: 16px 18px; background: var(--paper); color: var(--ink); border-radius: var(--radius); border-left: 6px solid var(--rose); box-shadow: var(--shadow-soft); transition: transform .2s; }
.hit:hover { transform: translateX(4px); }
.hit h3 { margin: 0 0 2px; font-size: 16px; }
.hit .m { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
.hit .s { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.hit mark { background: var(--gold-3); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- 司書室（管理） ---------- */
.office { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 20px 20px 80px; }
.office .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.office .tabs button { padding: 8px 16px; border: 1.5px solid rgba(92,60,40,.14); background: #fff; color: var(--ink-2); border-radius: 999px; letter-spacing: .08em; font-size: 13px; font-weight: 500; }
.office .tabs button.on { background: var(--ink); color: var(--cream); border-color: var(--ink); font-weight: 700; }
.panel { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: .08em; color: var(--ink); border-bottom: 1.5px dashed rgba(92,60,40,.16); padding-bottom: 8px; }
.panel .grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.panel table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.panel th, .panel td { border-bottom: 1px solid rgba(92,60,40,.10); padding: 8px 6px; text-align: left; vertical-align: top; }
.panel th { font-size: 12px; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.panel .table-wrap { overflow-x: auto; }
.panel .stat { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.panel .stat div { padding: 14px; background: var(--cream-2); border-radius: 14px; }
.panel .stat b { display: block; font-size: 26px; font-family: var(--latin); color: var(--rose-2); }
.panel .stat span { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
.reveal { margin: 12px 0; padding: 12px 14px; background: var(--gold-3); border: 1.5px dashed var(--gold); border-radius: 12px; font-size: 14px; }
.reveal code { font-size: 17px; user-select: all; background: #fff; padding: 2px 8px; border-radius: 6px; }
.panel textarea { min-height: 220px; line-height: 1.7; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .06em; font-weight: 700; }
.pill.general { background: var(--sage-3); color: var(--sage-2); }
.pill.premium { background: var(--rose-3); color: var(--rose-2); }
.pill.admin { background: var(--gold-3); color: var(--honey); }
.pill.off { background: var(--cream-3); color: var(--ink-3); }

/* ---------- 印刷（PDFとして保存） ---------- */
@media print {
  body { background: #fff; color: #000; }
  body::before, .hdr, .cover, .ribbon, .actions, .turn, .kind-tabs, .crumbs, .next-card, .read-guide { display: none !important; }
  .desk { padding: 0; }
  .paper { box-shadow: none; background: #fff; padding: 0; border-radius: 0; }
  .paper::before { display: none; }
  .prose { font-size: 12pt; line-height: 1.8; }
  .prose figure img { border: 0; box-shadow: none; }
  a { text-decoration: none; color: inherit; }
}
