/* ============================================================
   WEBNOVEL EPISODE READER PAGE
   ============================================================ */

.wnr-page {
  min-height: 100vh;
  background: var(--bg-primary, #12122a);
  padding-bottom: 80px;
}

/* ── 상단 바 ── */
.wnr-topbar {
  position: sticky;
  top: 64px;
  z-index: 80;
  background: var(--bg-secondary, #1a1a2e);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 52px;
}
body.light-mode .wnr-topbar {
  background: #f4f4ff;
  border-bottom-color: rgba(0, 0, 0, .07);
}

.wnr-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: rgba(255, 255, 255, .5);
  text-decoration: none;
  transition: color .18s;
}
.wnr-back:hover { color: #fff; }
body.light-mode .wnr-back { color: rgba(0, 0, 0, .45); }
body.light-mode .wnr-back:hover { color: #000; }

.wnr-ep-info {
  flex: 1;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
}

.wnr-font-ctrl { display: flex; align-items: center; gap: 8px; }
.wnr-font-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}
.wnr-font-btn:hover { background: rgba(255, 255, 255, .15); }
body.light-mode .wnr-font-btn { background: rgba(0, 0, 0, .07); }
body.light-mode .wnr-font-btn:hover { background: rgba(0, 0, 0, .13); }

/* ── 본문 영역 ── */
.wnr-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

.wnr-ep-header {
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  padding-bottom: 24px;
}
body.light-mode .wnr-ep-header { border-bottom-color: rgba(0, 0, 0, .08); }

.wnr-book-name {
  font-size: .78rem;
  color: rgba(255, 255, 255, .4);
  margin-bottom: 6px;
}
body.light-mode .wnr-book-name { color: rgba(0, 0, 0, .4); }

.wnr-ep-num {
  font-size: .75rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: 8px;
}

.wnr-ep-title {
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.3;
}

/* ── 본문 단락 ── */
.wnr-body { line-height: 1.95; }

.wnr-para {
  margin-bottom: 1.4em;
  font-size: 1rem;
  color: rgba(255, 255, 255, .82);
}
body.light-mode .wnr-para { color: rgba(0, 0, 0, .75); }

.wnr-para.dialogue {
  padding-left: 16px;
  border-left: 2px solid rgba(99, 102, 241, .4);
  color: rgba(255, 255, 255, .9);
}
body.light-mode .wnr-para.dialogue { color: rgba(0, 0, 0, .85); }

.wnr-no-content {
  opacity: .4;
}

/* ── AI 작성 뱃지 ── */
.wnr-ai-footer {
  margin-top: 48px;
  text-align: center;
}
.wnr-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, .07);
  margin-bottom: 28px;
}
body.light-mode .wnr-divider { border-top-color: rgba(0, 0, 0, .08); }

.wnr-ai-written-by {
  font-size: .7rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .3);
  text-transform: uppercase;
  margin-bottom: 10px;
}
body.light-mode .wnr-ai-written-by { color: rgba(0, 0, 0, .3); }

.wnr-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #fff;
  letter-spacing: .3px;
}

.wnr-end-mark {
  font-size: .75rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, .18);
}
body.light-mode .wnr-end-mark { color: rgba(0, 0, 0, .18); }

/* provider colors — solid bg */
.wnr-ai-gpt        { background: #1A1A1A; color: #fff; }
.wnr-ai-grok       { background: #6B7280; color: #fff; }
.wnr-ai-claude     { background: #F97316; color: #fff; }
.wnr-ai-gemini     { background: #38BDF8; color: #fff; }
.wnr-ai-qwen       { background: #7C3AED; color: #fff; }
.wnr-ai-llama      { background: #F5F5F5; color: #1a1a1a; }
.wnr-ai-deepseek   { background: #3B82F6; color: #fff; }
.wnr-ai-hyperclova { background: #22C55E; color: #fff; }
.wnr-ai-exaone     { background: #EC4899; color: #fff; }
.wnr-ai-mistral    { background: #EF4444; color: #fff; }

/* ── 이전/다음 네비게이션 ── */
.wnr-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  gap: 12px;
}
body.light-mode .wnr-nav { border-top-color: rgba(0, 0, 0, .08); }

.wnr-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
  color: inherit;
  font-size: .88rem;
  font-weight: 600;
  transition: background .18s;
  flex: 1;
  max-width: 240px;
}
.wnr-nav-btn:hover { background: rgba(99, 102, 241, .15); }
body.light-mode .wnr-nav-btn { background: rgba(0, 0, 0, .05); }
body.light-mode .wnr-nav-btn:hover { background: rgba(99, 102, 241, .1); }

.wnr-nav-btn.next { justify-content: flex-end; text-align: right; }
.wnr-nav-btn.disabled { opacity: .3; pointer-events: none; }

.wnr-nav-sub { font-size: .72rem; color: rgba(255, 255, 255, .4); }
body.light-mode .wnr-nav-sub { color: rgba(0, 0, 0, .4); }

.wnr-nav-ep {
  font-size: .9rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 목차 버튼 ── */
.wnr-toc-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, .4);
  z-index: 200;
}

/* ── 목차 드로어 ── */
.wnr-toc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 300;
}
.wnr-toc-overlay.open { display: block; }

.wnr-toc-drawer {
  position: fixed;
  right: 0;
  top: 80px;
  bottom: 0;
  width: 300px;
  background: var(--bg-secondary, #1a1a2e);
  z-index: 301;
  padding: 24px 20px;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0, 0, 0, .4);
  transform: translateX(100%);
  transition: transform .3s;
}
body.light-mode .wnr-toc-drawer { background: #f4f4ff; }
.wnr-toc-drawer.open { transform: translateX(0); }

.wnr-toc-title {
  font-size: .92rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
body.light-mode .wnr-toc-title { border-bottom-color: rgba(0, 0, 0, .1); }

.wnr-toc-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .84rem;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  margin-bottom: 2px;
}
.wnr-toc-item:hover { background: rgba(255, 255, 255, .07); }
.wnr-toc-item.current {
  background: rgba(99, 102, 241, .15);
  color: #a5b4fc;
  font-weight: 600;
}
body.light-mode .wnr-toc-item:hover { background: rgba(0, 0, 0, .05); }
body.light-mode .wnr-toc-item.current { color: #4f46e5; }

/* ── 반응형 ── */
@media (max-width: 640px) {
  .wnr-inner { padding: 28px 18px; }
  .wnr-topbar { top: 56px; padding: 0 14px; }
  .wnr-nav-btn { padding: 10px 14px; font-size: .82rem; }
  .wnr-toc-drawer { width: 260px; }
}
