:root {
  --bg: #f6f9ff;
  --surface: #ffffff;
  --ink: #182033;
  --muted: #5f6b7a;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --accent: #f97316;
  --accent-2: #ec4899;
  --border: #dbe4ff;
  --shadow: 0 20px 50px rgba(37, 99, 235, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.site {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 10% -5%, #ffe8b7 0%, transparent 55%),
    radial-gradient(900px 420px at 90% -10%, #c7e7ff 0%, transparent 55%),
    radial-gradient(800px 380px at 50% 0%, #ffd6f0 0%, transparent 60%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7ff 30%, #fef6e9 70%, #f8fbff 100%);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 500;
  color: var(--muted);
}

.nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: 0.2s ease;
}

.nav a:hover,
.nav a:focus {
  color: var(--ink);
  border-color: var(--brand);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-actions.mobile-only {
  display: none;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 12px;
  margin-top: 8px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.hero {
  padding: 64px 0 48px;
  background: linear-gradient(120deg, #eef2ff 0%, #fff7ed 45%, #ecfeff 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin-bottom: 16px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.section {
  padding: 48px 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title h2 {
  font-family: 'Fraunces', serif;
  margin: 0;
}

.section-title p {
  color: var(--muted);
  margin: 6px 0 0;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.content-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) minmax(0, 180px);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-weight: 700;
  margin: 0 0 10px;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.badge-warning {
  background: #fff4cc;
  color: #b45309;
}

.badge-nsfw {
  background: #ffe4e6;
  color: #be123c;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: space-between;
}

.list-item .meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.list-item.locked {
  background: #fff1f2;
  border-color: #fecaca;
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.novel-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.novel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.08);
  align-items: center;
}

.novel-row.is-nsfw {
  border-color: #fecaca;
  background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
}

.novel-main {
  display: flex;
  gap: 16px;
  align-items: center;
}

.novel-cover {
  position: relative;
  width: 96px;
  height: 128px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.novel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nsfw-pill {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(190, 18, 60, 0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.novel-body {
  display: grid;
  gap: 6px;
}

.novel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.novel-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.novel-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.novel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  align-items: stretch;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.book-grid.scrollable {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 20px;
}

.book-grid.scrollable::-webkit-scrollbar {
  height: 8px;
}

.book-grid.scrollable::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.25);
  border-radius: 999px;
}

.book-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 170px,
    rgba(120, 92, 60, 0.12) 170px,
    rgba(120, 92, 60, 0.12) 178px
  );
  pointer-events: none;
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.12);
  z-index: 1;
  min-width: 180px;
  scroll-snap-align: start;
}

.book-card.is-nsfw {
  border-color: #fecaca;
  box-shadow: 0 18px 30px rgba(244, 63, 94, 0.18);
}

.book-cover {
  position: relative;
  display: block;
  padding-top: 150%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #e0e7ff, #fef3c7);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.18);
  transform: translateZ(0);
}

.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0.08));
  opacity: 0.6;
}

.book-cover::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.7));
}

.book-info {
  display: grid;
  gap: 6px;
}

.book-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.book-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.book-actions {
  display: grid;
  gap: 8px;
}

.slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.slider-track {
  display: flex;
  transition: transform 0.55s ease;
}

.slider-slide {
  min-width: 100%;
  padding: 20px;
}

.slider-controls {
  position: absolute;
  inset: auto 16px 16px auto;
  display: flex;
  gap: 8px;
}

.slider-dots {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 32, 51, 0.25);
  border: none;
}

.slider-dot.is-active {
  background: var(--brand);
  width: 18px;
}

.promo {
  display: grid;
  gap: 16px;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.promo-card {
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.15);
}

.promo-highlight {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin: 0 0 10px;
}

.promo-meta {
  color: var(--muted);
  margin: 0;
}

.promo-image {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12px 6px 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rail-shell {
  overflow: hidden;
  width: 100%;
}

.rail::-webkit-scrollbar {
  height: 8px;
}

.rail::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.25);
  border-radius: 999px;
}

.rail .book-card {
  min-width: 180px;
  scroll-snap-align: start;
}

.rail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-featured {
  background: #ede9fe;
  color: #6d28d9;
}

.reader-shell {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.reader-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.reader-content p {
  margin-bottom: 1.2em;
}

.reader-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.form {
  display: grid;
  gap: 16px;
}

.input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  background: var(--surface);
}

.input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--brand);
}

.banner {
  padding: 16px 20px;
  border-radius: 16px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #075985;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.footer-title {
  font-weight: 600;
  color: var(--ink);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  justify-content: center;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
}

.pagination .active span {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .nav {
    position: fixed;
    top: 70px;
    right: 16px;
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
  }

  body.nav-open .nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-actions.desktop-only {
    display: none;
  }

  .nav-actions.mobile-only {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 40px 0 32px;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .novel-row {
    grid-template-columns: 1fr;
  }

  .novel-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .novel-main {
    align-items: flex-start;
  }

  .book-grid {
    padding: 14px;
  }

  .slider-slide {
    padding: 16px;
  }

  .promo {
    grid-template-columns: 1fr;
  }
}
