/* reader42: 문고판 디자인. 색은 아래 토큰에서, 다크 모드는 <head> 스크립트가 data-theme 으로 정한다 */
:root { --bg: #fff; --ink: #111; --mut: #5a5a5a; --rule: #dcdcdc; --bar: #fff; --on-bar: #111; --mark: #111; --soft: #efefef; --ok: #111; --accent: #111; --on-accent: #fff; --stamp: #e4572e; --display: "Gothic A1", sans-serif; --c1: #3fc7b5; --c2: #ff8a66; --c3: #ffc83d; color-scheme: light; }
:root[data-theme="dark"] { --stamp: #ff7a52; --bg: #121212; --ink: #f2f2f2; --mut: #a8a8a8; --rule: #333; --bar: #121212; --on-bar: #f2f2f2; --mark: #f2f2f2; --soft: #242424; --ok: #f2f2f2; --accent: #f2f2f2; --on-accent: #111; --c1: #0f6b60; --c2: #9a3a22; --c3: #8a6400; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bar); outline-offset: 2px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.sep { color: var(--mut); }
.bar { background: var(--bar); color: var(--on-bar); }
.bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.brand .em { width: 42px; height: 42px; flex: none; }
.brand .wm-s { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.me { font-size: 14px; flex: none; }
#theme { flex: none; width: 30px; height: 30px; border: 0; background: none; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; padding: 0; }
h1, h2, h3, .brand { font-family: var(--display); }
.brand { flex: none; }
.search { position: relative; margin-left: auto; flex: 0 1 240px; min-width: 0; }
.search input { width: 100%; height: 26px; border: 0; padding: 0 8px; font: 13px inherit; background: rgba(255,255,255,.88); color: #000; }
.hits { position: absolute; z-index: 20; top: 28px; left: 0; right: 0; min-width: 240px; margin: 0; padding: 0; list-style: none; background: var(--bg); color: var(--ink); border: 1px solid var(--mut); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.hits a { display: block; padding: 6px 8px; font-size: 14px; }
.hits a span { display: block; color: var(--mut); font-size: 12px; }
.hits a:hover, .hits a:focus, .hits li.on a { background: var(--soft); text-decoration: none; }
.hits li.on a { box-shadow: inset 3px 0 0 var(--bar); }
.hits .none { padding: 8px; color: var(--mut); font-size: 13px; }
.head { padding: 20px 0 6px; }
.head h1 { font-size: 22px; line-height: 1.3; margin: 0 0 4px; font-weight: 700; }
.lead { margin: 0; color: var(--mut); font-size: 14px; max-width: 70ch; }
.crumb { margin: 0 0 4px; font-size: 13px; color: var(--mut); }
.src { font-size: 12.5px; color: var(--mut); margin: 6px 0 0; }
.src a { text-decoration: underline; }
.track { width: 90px; height: 5px; background: var(--rule); display: inline-block; vertical-align: middle; }
.track span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .25s; }
.lists { list-style: none; padding: 0; margin: 14px 0 40px; }
.lcard { padding: 16px 0 20px; border-top: 1px solid var(--rule); }
.lk { display: block; }
.lk .meta { order: -1; margin-bottom: 10px; }
.lk { display: flex; flex-direction: column; }
.lcard h2 { font-size: 17px; font-weight: 700; margin: 0; line-height: 1.35; }
.cur { margin: 1px 0 0; font-size: 12.5px; color: var(--mut); }
.covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.covers img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--soft); box-shadow: 0 1px 0 var(--rule), 0 3px 10px rgba(0,0,0,.12); }
.subs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 28px; }
.subs .lcard { padding: 0; border: 0; min-width: 0; }
.subs h3 { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 10px 0 0; }
.subs .lk:hover h3 { text-decoration: underline; }
.stack { display: flex; height: 96px; }
.stack img { width: 64px; height: 96px; object-fit: cover; display: block; flex: none; margin-right: -34px; background: var(--soft); box-shadow: 2px 1px 6px rgba(0,0,0,.28); }
.stack img:last-child { margin-right: 0; }
.subs .prog { margin-top: 6px; }
.prog { margin-top: 10px; font-size: 13px; color: var(--mut); display: flex; align-items: center; gap: 8px; }
.prog p { margin: 0; order: -1; }
.prog b, .stat b { color: var(--ink); }
.ctotal { margin-top: 12px; }
.shared { margin: 10px 0 0; padding: 6px 10px; background: var(--soft); font-size: 13px; }
.board { margin-top: 12px; font-size: 13px; color: var(--mut); }
.board > .track { width: 100%; display: block; height: 5px; margin-bottom: 8px; }
.stat .big { display: inline; margin: 0 10px 0 0; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.nick { height: 28px; border: 1px solid var(--mut); padding: 0 8px; background: transparent; color: var(--ink); font: 13px inherit; width: 150px; }
.share, .dlg-acts button, .dlg-acts a { height: 28px; padding: 0 12px; border: 0; background: var(--accent); color: var(--on-accent); font: 600 13px inherit; cursor: pointer; display: inline-flex; align-items: center; }
.msg { margin: 4px 0 0; color: var(--ok); min-height: 1em; }
.books { list-style: none; margin: 8px 0 40px; padding: 0; }
.book { display: grid; grid-template-columns: 2.4em 40px minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.book .n { color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; }
.book img { width: 40px; height: 58px; object-fit: cover; display: block; background: var(--soft); }
.book h2 { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.35; }
.book .o { color: var(--mut); font-size: 13px; }
.book p { margin: 2px 0 0; font-size: 12.5px; color: var(--mut); }
.book p a { text-decoration: underline; }
.chk { width: 30px; height: 30px; border: 1.5px solid var(--mut); border-radius: 8px; background: none; color: transparent; cursor: pointer; font-size: 0; position: relative; padding: 0; }
.chk:hover { border-color: var(--ink); }
/* 읽음 도장: 비스듬한 이중 원과 "읽음". 찍힐 때 살짝 눌리는 움직임 */
.stampmark, .book.is-read .chk { width: 44px; height: 44px; border: 2.5px solid var(--stamp); border-radius: 50%; color: var(--stamp); background: none; transform: rotate(-14deg); display: grid; place-items: center; }
.stampmark::before, .book.is-read .chk::before { content: ""; position: absolute; inset: 3px; border: 1px dashed var(--stamp); border-radius: 50%; }
.stampmark::after, .book.is-read .chk::after { content: "읽음"; font: 800 12px/1 var(--display); letter-spacing: -0.02em; }
.book.is-read .chk { animation: stampin .22s ease-out; margin: -7px; }
@keyframes stampin { from { transform: rotate(-14deg) scale(1.5); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
.book.is-read h2 { color: var(--mut); }
.book.theirs { background: var(--soft); }
.card-dlg { border: 0; padding: 14px; background: var(--bg); color: var(--ink); max-width: min(92vw, 460px); }
.card-dlg canvas { width: 100%; height: auto; display: block; }
.dlg-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.book h2 a:hover { text-decoration: underline; }
.bp { padding: 18px 0 40px; }
.bp .crumb { margin-bottom: 10px; }
.bh { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 22px; }
.big { width: 140px; display: block; background: var(--soft); box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.info h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.3; }
.info p { margin: 2px 0; color: var(--mut); font-size: 14px; }
.go { background: var(--accent); color: var(--on-accent); padding: 6px 14px; font-weight: 600; font-size: 14px; }
.go:hover { text-decoration: none; filter: brightness(1.05); }
.rd { border: 1px solid var(--mut); background: none; color: var(--ink); font: 13px inherit; padding: 5px 10px; cursor: pointer; }
.rd[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.bp h2 { font-size: 16px; margin: 26px 0 8px; }
.chips, .nexts, .inlists { list-style: none; margin: 0; padding: 0; }
.inlists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.inlists .ct .cc { display: block; margin: 0 0 2px; }
.lchip { padding: 10px 0; border-top: 1px solid var(--rule); }
.ct { margin: 0; font-weight: 600; }
.ct a:hover, .basis a:hover { text-decoration: underline; }
.ct .cc { color: var(--mut); font-weight: 400; font-size: 13px; margin-right: 6px; }
.lchip .prog { margin-top: 4px; }
.basis { margin: 4px 0 0; font-size: 12.5px; color: var(--mut); }
.basis a { text-decoration: underline; }
.nexts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.nexts img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--soft); }
.nexts span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.35; }
.thread { margin-top: 26px; max-width: 74ch; }
.fine { margin: 0 0 12px; font-size: 12px; color: var(--mut); }
.c { border-left: 2px solid var(--rule); padding: 1px 0 1px 12px; margin: 0 0 18px; }
.hd { margin: 0 0 3px; color: var(--mut); font-size: 12.5px; }
.hd b { color: var(--ink); font-weight: 600; }
.hd a { color: var(--mut); text-decoration: underline; }
.c p.ko, .c p.en { margin: 0; white-space: pre-line; }
.c.has-ko .en { display: none; color: var(--mut); margin-top: 6px; }
.c.has-ko.show-orig .en { display: block; }
.flip { border: 0; background: none; padding: 0; color: var(--mut); text-decoration: underline; cursor: pointer; font: inherit; }
.prose { padding: 20px 0 40px; max-width: 70ch; }
.prose h1 { font-size: 22px; line-height: 1.35; margin: 0 0 12px; }
.prose h2 { font-size: 16px; margin: 24px 0 6px; }
.prose p { margin: 0 0 6px; }
footer a { text-decoration: underline; }
footer p { margin: 0 0 4px; }
footer .pp-copy { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 20px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 10px 14px; background: var(--accent); color: var(--on-accent); font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pp-in { margin: 0 0 18px; padding: 12px 14px; background: var(--soft); }
.pp-in .pp-status { margin: 0; }
.pp .share { height: 34px; }
footer { border-top: 2px solid var(--accent); color: var(--mut); font-size: 12px; padding-top: 12px; padding-bottom: 30px; }
@media (max-width: 560px) {
  .search input { font-size: 16px; height: 32px; }
  .me .lb { display: none; }
  .bar .wrap { gap: 8px; min-height: 48px; }
  .chk { width: 38px; height: 38px; }
  .book { grid-template-columns: 1.8em 40px minmax(0, 1fr) auto; }
  .go, .rd { padding: 10px 14px; }
  .nick, .share { height: 40px; }
  .head h1 { font-size: 24px; }
  .subs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .subs .track { width: 56px; }
  .brand .wm-s { font-size: 20px; } .brand .em { width: 32px; height: 32px; }
  .search { margin-left: 0; flex: 1 1 auto; }
  .bh { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .big { width: 96px; }
  .nexts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inlists { grid-template-columns: minmax(0, 1fr); }
  .covers { grid-template-columns: repeat(4, minmax(0, 1fr)); } .covers img:nth-child(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 문고판: 컬렉션마다 표지 색 띠, 묵직한 고딕 */
:root .bar { border-bottom: 3px solid var(--ink); }
:root .brand { gap: 10px; }
:root .search input { border: 2px solid var(--ink); background: transparent; color: var(--ink); }
:root .head h1 { font-size: clamp(30px, 6vw, 52px); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
:root h2, :root h3, :root .info h1, :root .prose h1 { font-weight: 800; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chips[hidden] { display: none; }
.chips button { border: 2px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
:root .tiles { gap: 14px; margin-bottom: 20px; }
:root .tiles .lcard { padding: 16px; background: var(--c1); }
:root .tiles .lcard.c2 { background: var(--c2); }
:root .tiles .lcard.c3 { background: var(--c3); }
:root .tiles .lcard, :root .tiles .lcard a, :root .tiles .lcard b { color: #111; }
[data-theme="dark"] .tiles .lcard, [data-theme="dark"] .tiles .lcard a, [data-theme="dark"] .tiles .lcard b { color: #fff; }
:root .tiles .prog { color: inherit; }
:root .tiles .track { background: rgba(0,0,0,.2); }
:root .tiles .track span { background: currentColor; }
@media (max-width: 560px) {
  :root .tiles { gap: 10px; }
  :root .tiles .lcard { padding: 12px; }
  :root .tiles .stack { height: 78px; }
  :root .tiles .stack img { width: 52px; height: 78px; margin-right: -30px; }
  :root .tiles .stack img:last-child { margin-right: 0; }
}
:root .subs h3 { font-size: 16px; }

/* 휴대폰: 엠블럼만 (검색창 자리를 위해 reader42 글자도 숨김) */
@media (max-width: 420px) { html:root .brand .wm-s { display: none; } }

/* 항해 일지(/me/) */
a.me { text-decoration: none; color: inherit; border-bottom: 2px solid currentColor; padding-bottom: 1px; }
a.me:hover { opacity: .75; }
.me-sum { margin: 6px 0 4px; }
.me-sum .rank { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--rule); max-width: 760px; }
.rk-em svg { width: 64px; height: 64px; display: block; border-radius: 50%; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.rk-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.rk-tx > span { font-size: 13px; color: var(--mut); }
.rk-tx b { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.2; }
.rk-steps { display: flex; gap: 4px; margin-top: 6px; max-width: 240px; }
.rk-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); }
.me-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; max-width: 760px; }
.mn { position: relative; overflow: hidden; background: var(--c1); color: #111; padding: 16px 18px 18px; min-height: 150px; display: flex; flex-direction: column; }
.mn-done { background: var(--c2); } .mn-go { background: var(--c3); }
.mn::after { content: ""; position: absolute; right: -34px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%; border: 14px solid rgba(255,255,255,.22); }
.mn h3 { display: flex; align-items: center; gap: 6px; margin: 0; font: 700 13.5px/1.2 "IBM Plex Sans KR", sans-serif; letter-spacing: 0; }
.mn h3 svg { width: 18px; height: 18px; flex: none; }
.mv { margin: 8px 0 0; font-size: 16px; font-weight: 700; }
.mv b { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -0.03em; margin-right: 2px; }
.mc { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; position: relative; z-index: 1; }
.mc a { text-decoration: underline; }
.mbar { margin-top: auto; height: 6px; background: rgba(0,0,0,.14); border-radius: 3px; overflow: hidden; position: relative; z-index: 1; }
.mbar i { display: block; height: 100%; width: 0; background: #111; border-radius: 3px; transition: width .4s; }
.mminis { margin-top: auto; display: flex; gap: 2px; position: relative; z-index: 1; min-height: 32px; }
.mminis svg { width: 28px; height: 32px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.mminis i { font-style: normal; font-size: 12px; font-weight: 700; align-self: center; margin-left: 4px; }
.me-sec { margin: 28px 0; }
.me-sec h2 { font-size: 20px; margin: 0 0 12px; }
.badges { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 12px; }
.badge a { display: flex; flex-direction: column; align-items: center; text-align: center; color: inherit; }
.badge a:hover { text-decoration: none; }
.badge a:hover svg { transform: translateY(-2px) rotate(-3deg); }
.badge svg { width: 104px; height: 118px; display: block; transition: transform .2s; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.badge .rib { margin-top: -40px; position: relative; background: var(--ink); color: var(--bg); font: 800 12px/1 var(--display); padding: 5px 12px; border-radius: 3px; }
.badge.stale .rib { background: #a9a9a9; color: #fff; }
.badge b { margin-top: 18px; font-size: 14px; line-height: 1.3; }
.badge .bm { font-size: 12px; color: var(--mut); margin-top: 2px; }
.near { list-style: none; margin: 0 0 8px; padding: 0; }
.near li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* 받을 배지: 색을 빼고 흐리게. 마우스를 올리면 조금 커지고 진해지기만 한다(색은 완주해야 생긴다) */
.near .nb { flex: none; opacity: .28; filter: grayscale(1); transition: opacity .2s, transform .2s; }
.near .nb svg { width: 60px; height: 68px; display: block; }
.near li:hover .nb { opacity: .5; transform: scale(1.08); }
.near .prog { margin-top: 4px; }
.near .track { width: 120px; }
.mybooks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 12px; }
.mybooks a { display: block; font-size: 12.5px; line-height: 1.35; }
.mybooks img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; background: var(--soft); margin-bottom: 6px; box-shadow: 2px 1px 6px rgba(0,0,0,.2); }
/* 공유 카드 모양 고르기: 한 줄 세그먼트 */
.looks { display: inline-flex; gap: 2px; margin-bottom: 10px; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; }
.looks button { border: 0; border-radius: 999px; background: none; color: var(--ink); padding: 6px 16px; font: 600 13px inherit; cursor: pointer; }
.looks button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) {
  .me-nums { grid-template-columns: minmax(0, 1fr); } .mn { min-height: 0; } .mv b { font-size: 36px; } .mbar, .mminis { margin-top: 10px; }
  .mybooks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 모든 책 */
.to-books { align-self: center; margin-left: auto; font-weight: 600; font-size: 14px; text-decoration: underline; }
.ab-unread { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.ab-list .book p + p { color: var(--mut); }

/* 항해 일지: 읽은 책 표지 위에 도장 */
.mybooks a { position: relative; }
.mybooks .stampmark { position: absolute; top: 6px; right: 4px; width: 46px; height: 46px; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.stampmark.num::after { content: attr(data-n); font-size: 19px; letter-spacing: -0.04em; }
.stampmark.num.n3::after { font-size: 15px; }
.stampmark.num::before { inset: 3px; }
.mybooks .stampmark.num { width: 48px; height: 48px; }
.nextslot .slot { display: grid; place-items: center; aspect-ratio: 2 / 3; border: 2px dashed var(--rule); margin-bottom: 6px; transition: border-color .2s; }
.nextslot a:hover .slot { border-color: var(--stamp); }
.nextslot a:hover { text-decoration: none; }
.nextslot .stampmark { position: static; opacity: .35; background: none; box-shadow: none; width: 56px; height: 56px; }
.nextslot a:hover .stampmark { opacity: .8; }
.nextslot > a > span:last-child { color: var(--mut); }

/* 404 */
.nf { text-align: center; margin: 0 auto; padding-top: 48px; }
.nf-em svg { width: 120px; height: 120px; display: block; margin: 0 auto 18px; animation: nfspin 6s ease-in-out infinite; }
@keyframes nfspin { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.nf .acts { justify-content: center; margin-top: 18px; }
.nf .share { height: 36px; padding: 0 16px; }
