/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-deep: #0a0a1a;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --bg-surface: #16163a;
  --border: rgba(139, 92, 246, 0.15);
  --border-glow: rgba(139, 92, 246, 0.4);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --accent: #8b5cf6;
  --accent2: #ec4899;
  --accent3: #06b6d4;
  --gradient1: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient2: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'Noto Sans JP', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--accent2); }
img { max-width: 100%; height: auto; display: block; }
/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,10,26,0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; gap: 1rem;
}
.logo { display: flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 700; font-size: 1.3rem; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-family: 'Courier New', monospace; letter-spacing: -0.5px; }
.logo .accent { background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-search { flex: 1; max-width: 400px; }
.search-input {
  width: 100%; padding: 0.5rem 1rem; padding-right: 2.5rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 0.9rem; outline: none;
  transition: border-color 0.3s;
}
.search-input:focus { border-color: var(--accent); }
.search-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem;
}
.nav-search form { position: relative; }
.lang-switch { position: relative; }
.lang-btn {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); padding: 0.4rem 0.8rem;
  cursor: pointer; font-size: 0.85rem;
}
.lang-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; min-width: 120px;
  box-shadow: var(--shadow);
}
.lang-menu.open { display: block; }
.lang-menu a {
  display: block; padding: 0.5rem 1rem; color: var(--text); font-size: 0.9rem;
}
.lang-menu a:hover { background: var(--bg-surface); }
/* ===== Hero ===== */
.hero {
  position: relative; padding: 100px 1.5rem 40px; text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,92,246,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(236,72,153,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(6,182,212,0.08) 0%, transparent 50%);
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero-title {
  font-size: 2rem; margin-bottom: 0.5rem;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-icon { font-size: 2.2rem; -webkit-text-fill-color: initial; }
.hero-sub { color: var(--text-muted); font-size: 1rem; margin-bottom: 1.5rem; }
.hero-tags { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.tag-glow {
  padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.85rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(139,92,246,0.2); }
  50% { box-shadow: 0 0 15px rgba(139,92,246,0.4); }
}

/* ===== Section ===== */
.section-header {
  max-width: var(--max-width); margin: 0 auto 1.5rem;
  padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between;
}
.section-title {
  font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem;
}
.title-deco { color: var(--accent); font-size: 0.7rem; }
.section-count { color: var(--text-muted); font-size: 0.85rem; }
/* ===== Manga Grid ===== */
.manga-grid {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}
.manga-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.3s; cursor: pointer; display: block;
}
.manga-card:hover {
  transform: translateY(-4px); border-color: var(--border-glow);
  box-shadow: 0 8px 32px rgba(139,92,246,0.2);
}
.card-cover {
  position: relative; aspect-ratio: 3/4; background: var(--bg-surface);
  overflow: hidden;
}
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.manga-card:hover .card-cover img { transform: scale(1.05); }
.card-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--text-muted);
}
.card-placeholder span { font-size: 2.5rem; margin-bottom: 0.5rem; }
.card-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(10,10,26,0.85); padding: 2px 8px;
  border-radius: 10px; font-size: 0.7rem; color: var(--accent);
}
.card-views {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(10,10,26,0.85); padding: 2px 8px;
  border-radius: 10px; font-size: 0.7rem; color: var(--text-muted);
}
.card-info { padding: 0.75rem; }
.card-title {
  font-size: 0.9rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text);
}
.card-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mini-tag {
  font-size: 0.65rem; padding: 1px 6px; border-radius: 8px;
  background: var(--bg-surface); color: var(--accent); border: 1px solid var(--border);
}

/* ===== Empty ===== */
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 4rem 1rem; color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }

/* ===== Buttons ===== */
.btn-glow {
  display: inline-block; padding: 0.6rem 1.5rem;
  background: var(--gradient1); color: #fff; border-radius: 20px;
  font-weight: 600; font-size: 0.9rem; transition: all 0.3s;
}
.btn-glow:hover { box-shadow: 0 4px 20px rgba(139,92,246,0.4); color: #fff; transform: translateY(-2px); }

/* ===== Pagination ===== */
.pagination {
  max-width: var(--max-width); margin: 2rem auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}
.page-btn {
  padding: 0.4rem 1rem; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 0.85rem;
}
.page-btn:hover { border-color: var(--accent); }
.page-info { color: var(--text-muted); font-size: 0.85rem; }
/* ===== Series Detail ===== */
.series-detail { max-width: var(--max-width); margin: 0 auto; padding: 80px 1.5rem 2rem; }
.series-header { display: flex; gap: 2rem; margin-bottom: 2rem; }
.series-cover {
  width: 240px; min-width: 240px; aspect-ratio: 3/4;
  border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--border); background: var(--bg-surface);
}
.series-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder.large span { font-size: 4rem; }
.series-meta { flex: 1; }
.series-title {
  font-size: 1.8rem; margin-bottom: 0.5rem;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.series-alt-titles { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.alt-title { font-size: 0.85rem; color: var(--text-muted); }
.series-desc { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.7; }
.series-stats { display: flex; gap: 1.5rem; margin-bottom: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.series-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tag-link {
  padding: 0.25rem 0.75rem; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 16px; font-size: 0.8rem; color: var(--accent);
}
.tag-link:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.btn-start { font-size: 1rem; padding: 0.75rem 2rem; }

/* ===== Chapter List ===== */
.chapter-section { margin-top: 2rem; }
.chapter-list { display: flex; flex-direction: column; gap: 2px; }
.chapter-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem; transition: all 0.2s;
}
.chapter-item:hover { background: var(--bg-card-hover); border-color: var(--border-glow); }
.ch-num { color: var(--accent); font-weight: 600; min-width: 60px; }
.ch-title { flex: 1; }
.ch-views { color: var(--text-muted); font-size: 0.8rem; }
.ch-date { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Reader ===== */
.reader { max-width: 800px; margin: 0 auto; padding-top: 70px; }
.reader-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,26,0.95); backdrop-filter: blur(20px);
  padding: 0.75rem 1rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.reader-back { color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
.reader-info { flex: 1; text-align: center; }
.reader-series { display: block; font-size: 0.85rem; color: var(--text); font-weight: 600; }
.reader-ch { font-size: 0.75rem; color: var(--text-muted); }
.reader-nav { display: flex; gap: 0.5rem; }
.nav-btn {
  padding: 0.3rem 0.6rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.8rem;
}
.reader-images { display: flex; flex-direction: column; align-items: center; }
.reader-page { width: 100%; position: relative; }
.reader-page img { width: 100%; }
.page-num {
  text-align: center; padding: 0.5rem; font-size: 0.8rem; color: var(--text-muted);
}
.reader-bottom {
  display: flex; justify-content: center; gap: 1rem;
  padding: 2rem 1rem; border-top: 1px solid var(--border);
}
/* ===== Footer ===== */
.footer {
  margin-top: 4rem; padding: 2rem 1.5rem;
  border-top: 1px solid var(--border); text-align: center;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-brand { margin-bottom: 1rem; }
.footer-brand .accent {
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.footer-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }
.footer-links { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-title { font-size: 1.5rem; }
  .manga-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
  .series-header { flex-direction: column; align-items: center; text-align: center; }
  .series-cover { width: 180px; min-width: 180px; }
  .series-stats, .series-tags { justify-content: center; }
  .series-alt-titles { justify-content: center; }
  .reader-header { flex-wrap: wrap; justify-content: center; }
  .reader-info { order: -1; width: 100%; }
  .chapter-item { flex-wrap: wrap; gap: 0.5rem; }
  .ch-date { display: none; }
}
@media (max-width: 480px) {
  .manga-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .card-info { padding: 0.5rem; }
  .card-title { font-size: 0.8rem; }
  .nav-search { display: none; }
}

/* ===== Main Content ===== */
.main-content { min-height: calc(100vh - 200px); }
