:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f5;
  --surface: #ffffff;
  --ink: #15171e;
  --ink-soft: #4a4e59;
  --ink-faint: #888c96;
  --line: rgba(21, 23, 30, .1);
  --line-strong: rgba(21, 23, 30, .18);
  --border: #e0e0e0;
  --accent: #ff5a36;
  --accent-ink: #9c2d13;
  --accent-soft: #ffe4da;
  --accent-2: #1f8f7a;
  --accent-2-soft: #d8f3ec;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(21, 23, 30, .06);
  --shadow-md: 0 12px 30px rgba(21, 23, 30, .1);
  --shadow-lg: 0 24px 60px rgba(21, 23, 30, .18);
  --font-sans: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  --maxw: 1240px;
  --dur-fast: 150ms;
  --dur: 280ms;
  --dur-slow: 480ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --bg: #15171e;
  --bg-alt: #1e212b;
  --ink: #f5f5f5;
  --ink-soft: #b0b4c0;
  --ink-faint: #6b7080;
  --border: #2c313c;
}

body, .comic-card, .admin-table-wrap, .modal, input, textarea, .site-header {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  margin-left: 15px;
}
.theme-toggle-btn:hover { background: var(--bg-alt); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

html.page-enter, html.page-enter body { opacity: 0; }
html.page-enter-active body { animation: page-fade-in var(--dur-slow) var(--ease) forwards; }
html.page-exit body { animation: page-fade-out 200ms var(--ease) forwards; }
@keyframes page-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-fade-out { to { opacity: 0; transform: translateY(-8px); } }

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-1 { transition-delay: 60ms; }
.reveal-2 { transition-delay: 120ms; }
.reveal-3 { transition-delay: 180ms; }
.reveal-4 { transition-delay: 240ms; }

html.has-custom-cursor,
html.has-custom-cursor a,
html.has-custom-cursor button,
html.has-custom-cursor input,
html.has-custom-cursor select,
html.has-custom-cursor textarea,
html.has-custom-cursor .comic-card { cursor: none; }

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 200ms ease, width var(--dur) var(--ease), height var(--dur) var(--ease), background var(--dur) var(--ease);
  will-change: transform;
}
.cursor-dot {
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent);
  border-radius: 50%;
}
.cursor-ring {
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  opacity: .35;
  transition: opacity 200ms ease, width var(--dur) var(--ease), height var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cursor-ring--hover {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  background: rgba(255, 90, 54, .08);
  border-color: var(--accent);
}
.cursor-dot--hover { background: var(--accent-ink); }
.cursor-ring--click { transform-origin: center; filter: brightness(.95); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: #ff6f49; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-outline-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); backdrop-filter: blur(6px); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .22); }
.btn-danger { background: #fff; color: #c23b22; border-color: #f1c3b5; }
.btn-danger:hover { background: #fdeee9; }
.btn-sm { padding: 8px 16px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 238, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.15rem; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--ink) 0%, #353a4a 100%);
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-weight: 500; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 56px;
  color: #fff;
  background: radial-gradient(120% 160% at 10% 0%, #2a2f42 0%, #15171e 55%, #0c0d12 100%);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); }
.hero::before {
  width: 420px; height: 420px;
  right: -120px; top: -160px;
  background: radial-gradient(circle, rgba(255, 90, 54, .35), transparent 70%);
}
.hero::after {
  width: 320px; height: 320px;
  left: -100px; bottom: -140px;
  background: radial-gradient(circle, rgba(31, 143, 122, .35), transparent 70%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  color: #ffd8cb;
}
.hero h1 { margin-top: 18px; font-family: var(--font-display); font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.08; font-weight: 600; }
.hero p.lead { margin-top: 16px; max-width: 50ch; color: rgba(255, 255, 255, .76); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat-card {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-md);
  padding: 20px;
  backdrop-filter: blur(6px);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.stat-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .12); }
.stat-card .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: #fff; }
.stat-card .label { margin-top: 4px; font-size: .8rem; color: rgba(255, 255, 255, .65); text-transform: uppercase; letter-spacing: .06em; }

.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.section-head p { color: var(--ink-soft); margin-top: 6px; max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 700; color: var(--accent-ink); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.search-field { position: relative; flex: 1 1 260px; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-faint); }
.search-field input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.search-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select-field select {
  padding: 11px 36px 11px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" stroke="%23565a66" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 14px center;
  appearance: none;
  cursor: pointer;
}
.select-field select:focus { outline: none; border-color: var(--accent); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--dur-fast) ease;
}
.tag-chip:hover { border-color: var(--ink); color: var(--ink); }
.tag-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.results-meta { color: var(--ink-faint); font-size: .85rem; margin-bottom: 18px; }

.comic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px; }
.comic-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  transform-style: preserve-3d;
  perspective: 800px;
}
.comic-card:hover { transform: translateY(-8px) scale(1.015); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.comic-card .cover-wrap { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
.comic-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.comic-card:hover .cover-wrap img { transform: scale(1.06); }
.comic-card .card-body { padding: 14px 16px 18px; }
.comic-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.comic-card .meta-line { margin-top: 4px; font-size: .8rem; color: var(--ink-faint); }
.comic-card .card-footer { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--accent-2-soft);
  color: var(--accent-2);
}
.pages-count { font-size: .76rem; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 4px; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.cover-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  overflow: hidden;
}
.cover-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.4px);
  background-size: 11px 11px;
  mix-blend-mode: overlay;
}
.cover-placeholder::after { content: ""; position: absolute; inset: -20%; background: var(--c3); opacity: .18; }
.cover-pat-0::after { clip-path: polygon(0 0, 45% 0, 10% 100%, 0 100%); }
.cover-pat-1::after { clip-path: circle(38% at 85% 20%); }
.cover-pat-2::after { clip-path: polygon(100% 0, 100% 60%, 60% 0); }
.cover-pat-3::after { clip-path: polygon(0 60%, 40% 100%, 0 100%); }
.cover-pat-4::after { clip-path: circle(30% at 15% 85%); }
.cover-pat-5::after { clip-path: polygon(70% 100%, 100% 100%, 100% 40%); }
.cover-initials {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 700;
  color: rgba(255, 255, 255, .94);
  letter-spacing: .02em;
  text-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.cover-sheen { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .22) 0%, transparent 35%); }
.cover-placeholder.cover-placeholder--lg .cover-initials { font-size: clamp(3rem, 8vw, 4.6rem); }

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 28px; background: var(--bg-alt); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-note { max-width: 56ch; color: var(--ink-faint); font-size: .84rem; line-height: 1.6; }
.footer-note strong { color: var(--ink-soft); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-size: .86rem; font-weight: 600; color: var(--ink-soft); transition: color var(--dur-fast) ease; }
.footer-links a:hover { color: var(--accent-ink); }

.comments-section { background: var(--surface); border-top: 1px solid var(--line); }
.comment-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.comment-form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 90px; }
.comment-list { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.comment-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  animation: comment-in var(--dur-slow) var(--ease);
}
@keyframes comment-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.comment-avatar {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--ink), #3a3f52);
}
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comment-head strong { font-size: .92rem; }
.comment-head time { font-size: .76rem; color: var(--ink-faint); }
.comment-text { margin-top: 4px; font-size: .92rem; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.comment-status { margin-top: 10px; font-size: .82rem; color: var(--accent-2); min-height: 1.1em; }

.detail-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 48px 0; }
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; }
.detail-cover { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 3/4; box-shadow: var(--shadow-lg); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--ink-faint); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--accent-ink); }
.detail-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.1; }
.detail-author { margin-top: 8px; color: var(--ink-soft); font-size: 1rem; }
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.meta-pill { padding: 6px 13px; border-radius: var(--radius-pill); background: var(--bg-alt); font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.detail-desc { margin-top: 22px; max-width: 68ch; color: var(--ink-soft); line-height: 1.7; }
.detail-tags { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

.page-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.page-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.page-thumb:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-thumb .page-num {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.page-placeholder {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  overflow: hidden;
  color: #fff;
  text-align: center;
}
.page-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 14px);
}
.page-placeholder::after { content: ""; position: absolute; inset: -10%; background: var(--c3); opacity: .15; }
.page-placeholder.cover-pat-0::after { clip-path: polygon(0 0, 40% 0, 0 55%); }
.page-placeholder.cover-pat-1::after { clip-path: circle(32% at 80% 75%); }
.page-placeholder.cover-pat-2::after { clip-path: polygon(100% 100%, 55% 100%, 100% 55%); }
.page-placeholder.cover-pat-3::after { clip-path: polygon(0 100%, 35% 100%, 0 60%); }
.page-placeholder.cover-pat-4::after { clip-path: circle(28% at 20% 20%); }
.page-placeholder.cover-pat-5::after { clip-path: polygon(100% 0, 100% 45%, 65% 0); }
.page-placeholder__frame { position: relative; z-index: 1; padding: 10px; }
.page-placeholder__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  text-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.page-placeholder__title {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .9;
}
.page-placeholder__meta { display: none; }
.reader-stage .page-placeholder__meta { display: block; margin-top: 10px; font-size: .72rem; opacity: .75; max-width: 34ch; }

.reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 11, 15, .92);
  display: none;
  flex-direction: column;
  animation: fade-in var(--dur) var(--ease);
}
.reader-overlay.open { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.reader-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; color: #fff; }
.reader-top .reader-title { font-weight: 700; font-size: .94rem; }
.reader-top .reader-sub { font-size: .78rem; color: rgba(255,255,255,.6); }
.reader-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 70px 10px;
  min-height: 0;
}
.reader-page-wrap {
  max-width: min(640px, 86vw);
  max-height: 74vh;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  background: #111;
}
.reader-page-wrap img { width: 100%; height: 100%; object-fit: contain; background: #0c0d12; }
.reader-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.reader-nav-btn:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.06); }
.reader-nav-btn.prev { left: 14px; }
.reader-nav-btn.next { right: 14px; }
.reader-nav-btn:disabled { opacity: .3; pointer-events: none; }
.reader-bottom { padding: 14px 22px 22px; }
.reader-progress { height: 4px; border-radius: 2px; background: rgba(255,255,255,.15); overflow: hidden; margin-bottom: 14px; }
.reader-progress-bar { height: 100%; background: var(--accent); transition: width var(--dur) var(--ease); }
.reader-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.reader-thumbs::-webkit-scrollbar { height: 6px; }
.reader-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }
.reader-thumb {
  flex: none;
  width: 54px;
  aspect-ratio: 3/4;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .6;
  transition: opacity var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.reader-thumb:hover { opacity: 1; transform: translateY(-2px); }
.reader-thumb.active { opacity: 1; border-color: var(--accent); }
.reader-thumb img { width: 100%; height: 100%; object-fit: cover; }

.admin-shell { min-height: calc(100vh - 72px); }
.login-wrap {
  max-width: 420px;
  margin: 64px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.login-wrap h1 { font-family: var(--font-display); font-size: 1.6rem; }
.login-wrap p.hint { margin-top: 8px; color: var(--ink-faint); font-size: .86rem; }
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.login-error { color: #c23b22; font-size: .85rem; min-height: 1.1em; }
.login-error.shake { animation: shake 420ms ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.notice-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff4e6;
  border: 1px solid #ffdca8;
  color: #7a4b06;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: .84rem;
  margin-bottom: 24px;
}
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 28px 0 10px; }
.admin-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 30px; }
.admin-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  min-width: 140px;
}
.admin-stat .num { font-size: 1.6rem; font-weight: 700; font-family: var(--font-display); }
.admin-stat .label { font-size: .76rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.admin-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: middle; }
.admin-table th { background: var(--bg-alt); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-cover { display: flex; align-items: center; gap: 12px; }
.mini-cover { width: 40px; height: 52px; border-radius: 6px; overflow: hidden; flex: none; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; gap: 8px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 15, .55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
  animation: fade-in var(--dur) var(--ease);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  animation: modal-in var(--dur) var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal.modal-sm { max-width: 420px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-family: var(--font-display); font-size: 1.3rem; }
.modal-close { background: var(--bg-alt); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; border: none; cursor: pointer; }

.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .full { grid-column: 1 / -1; }
.upload-box {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.upload-box:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-box input { display: none; }
.upload-preview { width: 96px; height: 128px; margin: 0 auto 10px; border-radius: 8px; overflow: hidden; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.page-upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 12px; }
.page-upload-item { position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.page-upload-item img { width: 100%; height: 100%; object-fit: cover; }
.page-upload-item .remove-page {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  font-size: .7rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.page-upload-item .page-order {
  position: absolute;
  bottom: 4px; left: 4px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .65rem;
  padding: 1px 6px;
  border-radius: 8px;
}
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: .86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  z-index: 400;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-cover { max-width: 260px; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .comment-form { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .reader-stage { padding: 0 10px; }
  .reader-nav-btn { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .cursor-dot, .cursor-ring { display: none; }
}

[data-theme="dark"] .site-header { background-color: #000 !important; border-bottom: 1px solid #222; }
[data-theme="dark"] .comments-section { background-color: #000 !important; }
[data-theme="dark"] .site-header .brand-text,
[data-theme="dark"] .site-header .brand-text small { color: #f5f5f5 !important; }
[data-theme="dark"] .nav-links a { color: #a0a0a0 !important; }
[data-theme="dark"] .nav-links a.active,
[data-theme="dark"] .nav-links a:hover { color: #ff5a36 !important; }
[data-theme="dark"] .comments-section h2,
[data-theme="dark"] .comments-section p,
[data-theme="dark"] .comments-section span,
[data-theme="dark"] .comments-section label { color: #f5f5f5 !important; }
[data-theme="dark"] .comments-section input,
[data-theme="dark"] .comments-section textarea { background-color: #1a1a1a; color: #fff; border: 1px solid #333; }
[data-theme="dark"] .brand-mark svg path { stroke: #ff5a36 !important; }
[data-theme="dark"] .brand-mark svg path:nth-child(2) { stroke: #fff !important; }

[data-theme="dark"] .filter-bar { background-color: #000 !important; border: 1px solid #222 !important; }
[data-theme="dark"] .filter-bar input,
[data-theme="dark"] .filter-bar select { background-color: #1a1a1a !important; color: #fff !important; border-color: #333 !important; }
[data-theme="dark"] .filter-bar input::placeholder { color: #888c96 !important; }
[data-theme="dark"] .filter-bar svg { stroke: #f5f5f5 !important; }
[data-theme="dark"] .filter-bar .tag-chip { background-color: #1a1a1a !important; color: #f5f5f5 !important; border: 1px solid #333 !important; }
[data-theme="dark"] .filter-bar .tag-chip:hover,
[data-theme="dark"] .filter-bar .tag-chip.active { background-color: #ff5a36 !important; color: #fff !important; border-color: #ff5a36 !important; }/* Fix standard image sizing in the reader */
.comic-reader img, .reader-page img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
  cursor: zoom-in; /* Shows a magnifying glass cursor */
}

/* Updated Fullscreen Overlay */
#fullViewModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0a0a0a;
  z-index: 99999;
  overflow: auto; /* Allows both vertical and horizontal scrolling when zoomed */
}

#fullViewModal.open {
  display: block;
}

.full-view-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-bottom: 80px;
}

/* Remove the width constraint so JS can control it */
.full-view-content img {
  width: 100%;
  max-width: 1400px;
  height: auto;
  display: block;
  margin-bottom: 10px;
  transition: width 0.1s ease;
}

/* Close Button */
.full-view-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100000;
  backdrop-filter: blur(5px);
}

/* NEW: Zoom Toolbar */
.zoom-controls {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.85);
  padding: 10px 20px;
  border-radius: 40px;
  display: flex;
  gap: 15px;
  z-index: 100001;
  align-items: center;
  backdrop-filter: blur(10px);
  border: 1px solid #333;
}

.zoom-controls button {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.zoom-text {
  color: white;
  font-family: monospace;
  font-size: 16px;
  min-width: 50px;
  text-align: center;
}

.zoom-reset {
  font-size: 14px !important;
  font-family: inherit;
  padding: 0 10px !important;
  width: auto !important;
  border-radius: 20px !important;
  background: #333 !important;
}