/* NOTJANG BOOOKS — 공통 스타일. 디자인 캔버스(Main/App/About/Download)의 규칙을 그대로 옮겼다. */
:root {
  --ink: #f2ece0;
  --bg: #110000;
  --font: 'Noto Serif', 'Noto Serif KR', 'Noto Serif JP', 'Apple SD Gothic Neo', serif;
}
/* 일본어일 때는 한자를 일본 글꼴로 */
html[lang="ja"] { --font: 'Noto Serif', 'Noto Serif JP', 'Noto Serif KR', serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.light { background: #ffffff; color: #111111; }
img { -webkit-user-drag: none; }

/* ── 로고 ─────────────────────────────────────── */
.logo { position: fixed; left: 40px; top: 36px; margin: 0; z-index: 5; display: block; }
.logo img { display: block; width: 260px; height: auto; }
h1.logo { pointer-events: none; }

/* ── 아래 가운데 둥근 툴바 ────────────────────── */
.toolbar { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 6; }
.seg { position: relative; display: flex; align-items: center; padding: 6px; border-radius: 999px; background: #1c1c1c; box-shadow: 0 12px 30px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06); }
.seg .pill { position: absolute; top: 6px; left: 6px; width: 68px; height: 52px; border-radius: 999px; background: #ffffff; box-shadow: 0 2px 8px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.08); transition: transform .42s cubic-bezier(.34,1.45,.5,1); }
.seg .it { all: unset; position: relative; z-index: 1; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 68px; height: 52px; border-radius: 999px; cursor: pointer; color: #8c8c8c; transition: color .25s ease; }
.seg .it:hover { color: #d0d0d0; }
.seg .it.on, .seg .it.on:hover { color: #111111; }
.seg .it:focus-visible { outline: 2px solid #ffffff; outline-offset: -4px; }
.seg .it svg { width: 22px; height: 22px; }
.seg .div { width: 1px; height: 28px; margin: 0 8px; background: #3a3a3a; flex: none; }

/* 흰 배경(다운로드) 버전 */
body.light .seg { background: #ffffff; box-shadow: 0 8px 22px rgba(0,0,0,.10), inset 0 0 0 1px rgba(0,0,0,.12); }
body.light .seg .pill { background: #111111; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
body.light .seg .it { color: #8a8a8a; }
body.light .seg .it:hover { color: #333333; }
body.light .seg .it.on, body.light .seg .it.on:hover { color: #ffffff; }
body.light .seg .it:focus-visible { outline-color: #111111; }
body.light .seg .div { background: #d9d9d9; }

/* ── 언어 스위치 ─────────────────────────────── */
.lang { position: fixed; right: 40px; top: 40px; display: flex; padding: 4px; border-radius: 999px; background: #1c1c1c; box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.06); z-index: 8; }
.lang .lpill { position: absolute; top: 4px; left: 4px; width: 46px; height: 40px; border-radius: 999px; background: #ffffff; transition: transform .42s cubic-bezier(.34,1.45,.5,1); }
.lang .lb { all: unset; position: relative; z-index: 1; box-sizing: border-box; width: 46px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: #8c8c8c; cursor: pointer; border-radius: 999px; transition: color .25s ease; }
.lang .lb:hover { color: #d0d0d0; }
.lang .lb.on, .lang .lb.on:hover { color: #111111; }
.lang .lb:focus-visible { outline: 2px solid #ffffff; outline-offset: -3px; }
.lang .lsel { display: none; }
body.light .lang { background: #ffffff; box-shadow: 0 6px 18px rgba(0,0,0,.10), inset 0 0 0 1px rgba(0,0,0,.12); }
body.light .lang .lpill { background: #111111; }
body.light .lang .lb { color: #8a8a8a; }
body.light .lang .lb:hover { color: #333333; }
body.light .lang .lb.on, body.light .lang .lb.on:hover { color: #ffffff; }
body.light .lang .lb:focus-visible { outline-color: #111111; }
body.light .lang .lsel { background-color: #ffffff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E"); color: #111111; box-shadow: 0 6px 18px rgba(0,0,0,.10), inset 0 0 0 1px rgba(0,0,0,.12); }

/* ── 상태 줄(연결 상태·오류) ───────────────────── */
.status { position: fixed; left: 40px; bottom: 36px; margin: 0; z-index: 5; font-size: 11px; letter-spacing: .02em; color: rgba(242,236,224,.45); pointer-events: none; max-width: 40vw; }
.status.err { color: #e0483e; pointer-events: auto; }
.status:empty { display: none; }

/* ── 폰 폭 ───────────────────────────────────── */
@media (max-width: 767px) {
  .logo { left: 16px; top: 16px; }
  .logo img { width: 120px; }
  .toolbar { bottom: 34px; }
  /* 폰: 언어는 오른쪽 위 작은 드롭다운 */
  .lang { right: 16px; top: 16px; padding: 0; background: none; box-shadow: none; }
  .lang .lpill, .lang .lb { display: none; }
  .lang .lsel { display: block; -webkit-appearance: none; appearance: none; height: 40px; padding: 0 30px 0 14px; border: 0; border-radius: 999px; background: #1c1c1c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 10px; box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.06); color: #ffffff; font: 800 12px/1 var(--font); letter-spacing: .06em; cursor: pointer; }
  .lang .lsel:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
  .status { left: 16px; bottom: 100px; max-width: 80vw; }
}
