/* ================================================================
   綺淫 Yínhuá — Modern Dark Theme
   ================================================================ */

:root {
  --sidebar-width: 240px;

  /* Palette */
  --bg: #08080d;
  --bg-elevated: #0e0e16;
  --card: #14141c;
  --card-hover: #1a1a26;
  --sidebar-bg: #06060a;
  --border: #1e1e2e;
  --border-light: #2a2a3a;

  /* Text */
  --text: #e4e4ec;
  --text-dim: #8888a0;
  --text-muted: #55556a;

  /* Brand */
  --primary: #fc3117;
  --primary-glow: rgba(252, 49, 23, 0.25);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.2);

  /* Interactions */
  --hover: rgba(255, 255, 255, 0.05);
  --pressed: rgba(255, 255, 255, 0.08);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Card redesign tokens */
  --card-min-width: 120px;
  --card-min-width-lg: 140px;
  --card-gap: 12px;
  --card-gap-sm: 8px;
  --cover-aspect-ratio: 0.7;
  --card-title-size: 0.75rem;
  --card-author-size: 0.68rem;
  --card-meta-size: 0.62rem;
}

/* ================================================================
   Light Theme
   ================================================================ */

:root[data-theme="light"] {
  --bg: #f8f7f4;
  --bg-elevated: #eeede9;
  --card: #ffffff;
  --card-hover: #f3f2ee;
  --sidebar-bg: #f0efeb;
  --border: #d8d7d0;
  --border-light: #e6e5de;

  --text: #1a1a22;
  --text-dim: #6b6b75;
  --text-muted: #9a9aa4;

  --hover: rgba(0, 0, 0, 0.04);
  --pressed: rgba(0, 0, 0, 0.07);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  --primary-glow: rgba(252, 49, 23, 0.15);
  --accent-glow: rgba(245, 158, 11, 0.15);

  /* Keep brand colors */
  --primary: #e62e10;
  --accent: #d68d00;
}

/* ================================================================
   Reset & Base
   ================================================================ */

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.25s ease;
}

* {
  box-sizing: border-box;
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   Layout
   ================================================================ */

.app-layout {
  display: flex;
  height: 100vh;
}

/* ================================================================
   Sidebar
   ================================================================ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand i {
  font-size: 1.2rem;
  color: var(--primary);
}

/* Logo mark */
.sidebar-brand a::before {
  content: '';
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px;
  margin: 0 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.18s var(--ease-out);
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--hover);
  color: var(--text);
}

.sidebar-nav a.active {
  background: rgba(252, 49, 23, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--primary);
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity 0.18s var(--ease-out);
}

.sidebar-nav a.active i {
  opacity: 1;
}

.sidebar-nav a:hover i {
  opacity: 0.9;
}

.sidebar-nav-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 18px;
}

/* ================================================================
   Content Area
   ================================================================ */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg);
}

/* ================================================================
   Section Header
   ================================================================ */

.section-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header i {
  opacity: 0.6;
  font-size: 0.85rem;
}

/* ================================================================
   Hero Carousel
   ================================================================ */

.hero-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
}

.carousel-track {
  display: flex;
  aspect-ratio: 11 / 1;
  position: relative;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-decoration: none;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 20px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.carousel-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.carousel-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s var(--ease-out);
  z-index: 2;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.7);
  border-color: rgba(255,255,255,0.3);
}

.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  right: 24px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
  .carousel-track {
    aspect-ratio: 10 / 1;
  }

  .carousel-caption {
    padding: 14px 12px 10px;
  }

  .carousel-title {
    font-size: 0.9rem;
  }

  .carousel-btn {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .carousel-dots {
    bottom: 10px;
    right: 16px;
  }
}

/* ================================================================
   Search Bar
   ================================================================ */

.search-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.88rem;
  width: 100%;
  outline: none;
  transition: all 0.2s var(--ease-out);
}

.search-bar:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar::placeholder {
  color: var(--text-muted);
}

/* ================================================================
   Manga Cards — Redesigned (mangacollec-inspired)
   ================================================================ */

.manga-thumb {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out);
}

.manga-thumb:hover {
  transform: translateY(-2px);
}

/* --- Cover wrapper --- */

.thumb-cover {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.manga-thumb .thumb-img {
  width: 100%;
  aspect-ratio: var(--cover-aspect-ratio);
  object-fit: cover;
  display: block;
  background: var(--card);
}

.thumb-img--placeholder {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

/* Lang badge on cover */

.thumb-cover .lang-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.8rem;
  line-height: 1;
  background: rgba(0,0,0,0.55);
  padding: 2px 5px;
  border-radius: 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  pointer-events: none;
  z-index: 2;
}

/* --- Text body --- */

.manga-thumb .thumb-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.7rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text);
  padding: 3px 0 2px;
}

/* --- Hover overlay --- */

.thumb-hover {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 3;
  padding: 6px;
  font-size: 0.66rem;
  color: #ddd;
  line-height: 1.4;
  text-align: center;
}

.manga-thumb:hover .thumb-hover {
  opacity: 1;
}

.thumb-hover .admin-edit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.thumb-hover .admin-edit-badge:hover {
  transform: scale(1.2);
}

/* ================================================================
   Manga Grids
   ================================================================ */

.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width-lg), 1fr));
  gap: var(--card-gap);
}

.manga-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
  gap: var(--card-gap-sm);
}

/* ================================================================
   Genre Pills
   ================================================================ */

.genre-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s var(--ease-out);
}

.genre-pill:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--text-dim);
}

.genre-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* ================================================================
   Tags Overlay (Genre selector modal)
   ================================================================ */

.tags-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.tags-overlay.open {
  display: flex;
}

.tags-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 480px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease-out);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================================================================
   Pagination
   ================================================================ */

.pagination {
  margin: 20px 0 0;
  display: flex;
  justify-content: center;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.pagination .page-link {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s var(--ease-out);
}

.pagination .page-link:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--border);
}

.pagination .active .page-link {
  color: #fff;
  font-weight: 600;
  background: var(--primary);
  border-color: var(--primary);
  pointer-events: none;
}

.pagination .disabled .page-link {
  opacity: 0.3;
  pointer-events: none;
}

/* ================================================================
   Card (generic)
   ================================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* ================================================================
   Stats Card (homepage counters)
   ================================================================ */

.stat-card {
  flex: 1;
  min-width: 100px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.2s var(--ease-out);
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.stat-card .stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================================================================
   Product Detail
   ================================================================ */

.product-layout {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.product-cover {
  flex: 0 0 auto;
  width: 240px;
}

.product-cover img {
  width: 100%;
  aspect-ratio: 0.666;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.product-info {
  flex: 1;
  min-width: 280px;
}

.product-info h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.product-info .author-link {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.product-info .author-link:hover {
  color: var(--text);
}

.product-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 24px;
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.product-meta .meta-label {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.product-meta .meta-value {
  color: var(--text);
}

/* Author bio card */
.bio-card {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 22px;
}

.bio-card .bio-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

/* Author header card */
.author-header {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
}

.author-portrait {
  flex: 0 0 auto;
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  background: var(--bg);
}

.author-info-block {
  flex: 1;
  min-width: 220px;
}

.author-info-block h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  display: inline;
}

.author-native-name {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 10px;
  font-weight: 400;
}

/* Social links bar */
.social-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.18s var(--ease-out);
  letter-spacing: 0.01em;
}

.social-link:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Social link colors */
.social-link.wiki    { background: #f8f9fa; color: #222; }
.social-link.mal     { background: #2e51a2; color: #fff; }
.social-link.twitter { background: #1d9bf0; color: #fff; }
.social-link.pixiv   { background: #0096fa; color: #fff; }
.social-link.fanbox  { background: #f5a623; color: #fff; }
.social-link.fantia  { background: #eb5b8b; color: #fff; }
.social-link.booth   { background: #222;   color: #fff; }
.social-link.website { background: var(--card); color: var(--text); border: 1px solid var(--border); }

/* ================================================================
   Badge / Tag
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.badge-primary {
  background: var(--primary);
  color: #fff;
}

.badge-accent {
  background: var(--accent);
  color: #000;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ================================================================
   Provisional Cover Badge
   ================================================================ */

.provisional-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(245, 158, 11, 0.92);
  color: #000;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ================================================================
   Series Badge ("Série X tomes") on Thumbnails
   ================================================================ */

.series-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(139, 92, 246, 0.92);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 4;
  transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out);
  white-space: nowrap;
}

.series-badge i {
  font-size: 0.55rem;
  opacity: 0.9;
}

.series-badge:hover {
  background: rgb(139, 92, 246);
  transform: scale(1.06);
}

.series-badge--complete {
  background: rgba(16, 185, 129, 0.92);
}

.series-badge--complete:hover {
  background: rgb(16, 185, 129);
}

/* ================================================================
   Collection Badges (owned / read) on Thumbnails
   ================================================================ */

.collect-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 2;
  pointer-events: none;
}

.collect-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}

.collect-badge--owned {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.collect-badge--read {
  background: rgba(59, 130, 246, 0.9);
  color: #fff;
}

.collect-badge--favorite {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* Alt name / alias pill */
.alias-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin: 2px;
}

/* Editor filter chip */
.editor-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ================================================================
   Buttons
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s var(--ease-out);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 5px 14px;
  font-size: 0.75rem;
}

/* ================================================================
   Empty State
   ================================================================ */

.empty-state {
  text-align: center;
  padding: 50px 0;
  color: var(--text-dim);
}

.empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.85rem;
  margin: 0;
}

/* ================================================================
   Editor Card
   ================================================================ */

.editor-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.editor-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
  transform: translateY(-2px);
}

.editor-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.editor-card .editor-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.editor-card .editor-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ================================================================
   Author list card
   ================================================================ */

.author-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.18s var(--ease-out);
}

.author-card:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
  transform: translateX(2px);
}

.author-card .author-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.author-card .author-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.author-card .author-native {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 5px;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 4px 6px;
  }

  .sidebar-nav a {
    padding: 8px 12px;
    margin: 0 2px;
    font-size: 0.78rem;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }

  .sidebar-nav a.active::before {
    display: none;
  }

  .sidebar-nav a i {
    font-size: 1rem;
  }

  .sidebar-nav a span {
    /* hide text on very small screens, show only icons */
  }

  .sidebar-nav-bottom {
    display: none;
  }

  .sidebar-divider {
    display: none;
  }

  .content {
    padding: 16px;
  }

  .product-layout {
    flex-direction: column;
  }

  .product-cover {
    width: 180px;
    margin: 0 auto;
  }

  .manga-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }

  .manga-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .author-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .sidebar-nav a {
    font-size: 0;
    padding: 10px 14px;
    gap: 0;
  }

  .sidebar-nav a i {
    font-size: 1.1rem;
    margin: 0;
  }

  .manga-grid,
  .manga-grid-sm {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .manga-thumb .thumb-title {
    font-size: 0.7rem;
  }

  .thumb-author {
    font-size: 0.65rem;
  }
}

/* ================================================================
   Utilities
   ================================================================ */

.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }

.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }

.me-1 { margin-right: 4px; }
.ms-1 { margin-left: 4px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 10px; }
.text-center { text-align: center; }

/* ================================================================
   Auth Pages (login / register / profile)
   ================================================================ */

.auth-page, .account-page {
  max-width: 420px;
  margin: 40px auto;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-input {
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}

select.form-input {
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.alert-error {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #f87171;
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary); filter: brightness(1.15); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--hover); border-color: var(--text-dim); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #f87171;
}
.btn-danger:hover { background: rgba(220, 38, 38, 0.15); }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-block { width: 100%; justify-content: center; }

/* Account page */
.account-card {
  text-align: center;
  padding: 30px 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.account-avatar {
  font-size: 3.5rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.account-card h1 {
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.account-badge { margin-bottom: 6px; }
.account-since {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .account-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 400px) {
  .account-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-card i {
  font-size: 1.2rem;
  color: var(--primary);
}

.stat-num {
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ================================================================
   Collection Page
   ================================================================ */

.collection-page { max-width: 1000px; }

.collection-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.collection-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.collection-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.collection-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.collection-tab:hover {
  background: var(--card-hover);
  color: var(--text);
}

.collection-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tab-count {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 400;
}



/* ================================================================
   Admin Pages
   ================================================================ */

.admin-page { max-width: 1000px; }
.admin-page h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.admin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.admin-card:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.admin-card i {
  font-size: 2rem;
  color: var(--primary);
}

.admin-card h3 {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
}

.admin-card p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: var(--hover); }

/* Admin filter form controls - use proper theme variables */
.admin-page select,
.admin-page input[type="text"] {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.admin-page select option {
  background: var(--card);
  color: var(--text);
}

.admin-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.genre-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
}

.pagination {
  display: flex;
  gap: 8px;
}

/* Checkbox/Switch label for admin sidebar */
.sidebar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ================================================================
   Avatar
   ================================================================ */

.avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--card);
}

.account-avatar .avatar-img {
  display: inline-block;
}

/* ================================================================
   Account Sections (profile edit, password, avatar upload)
   ================================================================ */

.account-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.account-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

/* ================================================================
   Chapters List (product page)
   ================================================================ */

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

.chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.chapter-item:hover {
  background: var(--card-hover);
}

/* Sub-chapter indentation */
.chapter-sub {
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid var(--border-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.chapter-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chapter-num-sub {
  width: 26px;
  height: 26px;
  font-size: 0.65rem;
  background: var(--accent);
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.chapter-meta {
  display: flex;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================================================
   Alternative Covers (product page)
   ================================================================ */

.alt-covers {
  margin-top: 12px;
}

.alt-covers-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.alt-covers-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alt-cover-thumb {
  display: block;
  width: 60px;
  height: 85px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.alt-cover-thumb:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--primary);
}

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

/* ================================================================
   Product Bottom: Description + Chapters side by side
   ================================================================ */

.product-bottom {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  align-items: flex-start;
}

.product-bottom-section {
  flex: 1;
  min-width: 0;
  max-width: 700px;
}

.product-description {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-line;
  margin: 0;
}

@media (max-width: 768px) {
  .product-bottom {
    flex-direction: column;
    gap: 20px;
  }

  .product-bottom-section {
    max-width: 100%;
  }
}

/* ================================================================
   Admin Edit Icon (product page)
   ================================================================ */

.admin-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
  text-decoration: none;
  vertical-align: middle;
  transition: all 0.18s var(--ease-out);
}

.admin-edit-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.1);
}

/* ================================================================
   Batch Selection (catalogue, planning)
   ================================================================ */

.batch-checkbox {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
}

.batch-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 3px;
}

.batch-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.batch-toolbar.active {
  transform: translateY(0);
  pointer-events: auto;
}

.batch-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  flex-wrap: wrap;
}

.batch-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.batch-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.batch-btn {
  padding: 4px 10px !important;
  font-size: 0.72rem !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
}

.batch-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.batch-btn-remove {
  padding: 4px 10px !important;
  font-size: 0.72rem !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(220,38,38,0.4);
  transition: all 0.15s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(220,38,38,0.15);
  color: #f87171;
}

.batch-btn-remove:hover {
  background: rgba(220,38,38,0.3);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .batch-toolbar-inner {
    gap: 8px;
    padding: 10px 12px;
  }
  .batch-count {
    font-size: 0.72rem;
  }
  .batch-btn, .batch-btn-remove {
    font-size: 0.65rem !important;
    padding: 3px 8px !important;
  }
}

/* ================================================================
   Language Flags
   ================================================================ */

.lang-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

/* ================================================================
   Multi-volume Series
   ================================================================ */

/* Series navigation block on product page */
.series-nav {
  margin-bottom: 22px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.series-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.series-nav-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s var(--ease-out);
}

.series-nav-title:hover {
  color: var(--primary);
}

.series-nav-title i {
  color: var(--accent);
}

.series-nav-pos {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.series-nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.series-nav-side {
  flex: 0 0 auto;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.series-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: all 0.18s var(--ease-out);
}

.series-arrow:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
  transform: translateY(-1px);
}

.series-arrow i {
  color: var(--primary);
  font-size: 0.9rem;
}

.series-arrow-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.series-arrow-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.series-arrow-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.series-nav-volumes {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}

.series-vol {
  flex: 0 0 auto;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.series-vol img {
  width: 64px;
  height: 92px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  transition: all 0.18s var(--ease-out);
}

.series-vol:hover img {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.series-vol.active img {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.series-vol-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-vol.active .series-vol-label {
  color: var(--primary);
  font-weight: 700;
}

/* ================================================================
   Public Series List Page (/series)
   ================================================================ */

.series-page {
  max-width: 1100px;
}

.series-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.series-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.series-page-title i {
  color: var(--accent);
}

.series-page-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.series-search {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 480px;
}

.series-search .search-bar {
  flex: 1;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.series-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Status filter pills (shared with the admin series page) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--card);
  text-decoration: none;
  transition: all 0.15s var(--ease-out);
}

.status-pill:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.status-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.status-pill i {
  font-size: 0.7rem;
}

.status-count {
  font-size: 0.64rem;
  opacity: 0.8;
  background: var(--bg-elevated);
  border-radius: 100px;
  padding: 1px 7px;
}

.status-pill.active .status-count {
  background: rgba(255, 255, 255, 0.2);
}

.series-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.series-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}

.series-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
  transform: translateY(-2px);
}

.series-card-cover {
  flex: 0 0 auto;
  width: 62px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.series-card-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.series-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.series-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-card-author {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
}

.series-card-count {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 9px;
  white-space: nowrap;
}

.series-card-complete {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.64rem;
  font-weight: 700;
  color: #fff;
  background: rgba(16, 185, 129, 0.9);
  border-radius: 100px;
  padding: 2px 9px;
  white-space: nowrap;
}

.series-card-owned {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.64rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 100px;
  padding: 2px 9px;
  white-space: nowrap;
}

.series-card-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 6px;
}

.series-card-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.4s var(--ease-out);
}

@media (max-width: 640px) {
  .series-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
  }
}

/* Serie page */
.serie-page {
  max-width: 1100px;
}

.serie-header {
  margin-bottom: 22px;
}

.serie-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.serie-title i {
  color: var(--accent);
}

.serie-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.serie-group {
  margin-bottom: 26px;
}

.serie-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.serie-group-header a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

.serie-group-header a:hover {
  color: var(--text);
}

.serie-group-header span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.serie-group-count {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 10px;
}

@media (max-width: 768px) {
  .series-nav-row {
    flex-direction: column;
    gap: 10px;
  }

  .series-nav-side {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    justify-content: space-between;
  }

  .series-arrow-title {
    max-width: 140px;
  }

  .series-nav-volumes {
    width: 100%;
  }
}

/* ================================================================
   Public Shared Library (/share/:hash)
   ================================================================ */

.share-page {
  max-width: 1000px;
}

.share-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.share-avatar {
  flex: 0 0 auto;
}

.share-avatar i {
  font-size: 3rem;
  color: var(--text-dim);
}

.share-avatar .avatar-img {
  width: 64px;
  height: 64px;
}

.share-header-info {
  flex: 1;
  min-width: 0;
}

/* QR code du lien de partage (page publique) — carte blanche scannable dans les deux thèmes */
.share-qr {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.share-qr img {
  display: block;
  width: 120px;
  height: 120px;
}

.share-qr p {
  margin: 2px 0 0;
  font-size: 0.62rem;
  color: #555;
  text-align: center;
  white-space: nowrap;
}

.share-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.share-title i {
  color: var(--accent);
}

.share-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.share-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

@media (max-width: 600px) {
  .share-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sur mobile, le header se replie et le QR passe sur sa propre ligne, aligné à droite */
  .share-header {
    flex-wrap: wrap;
  }

  .share-qr {
    margin-left: auto;
  }

  .share-qr img {
    width: 96px;
    height: 96px;
  }
}


/* ================================================================
   Age gate 18+ (splash première visite) + avertissement /share
   ================================================================ */

.age-gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #14141f 0%, #08080d 65%);
}

.age-gate-card {
  max-width: 480px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.age-gate-brand { margin-bottom: 20px; }

.age-gate-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.12);
  color: #ff4d4d;
  font-size: 1.7rem;
}

.age-gate-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}

.age-gate-text {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 26px;
}

.age-gate-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 22px;
}

.age-gate-actions .btn { min-width: 200px; }

.age-gate-legal {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.share-age-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: #f0b429;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}
